Ticket #548 (closed defect: fixed)

Opened 15 years ago

Last modified 15 years ago

bcfg2 fails to create new files when in paranoid mode

Reported by: [email protected] Owned by: desai
Priority: major Milestone: Bcfg2 0.9.6 Release
Component: bcfg2-client Version: 0.9.x
Keywords: paranoid Cc:


I'm running bcfg2 from trunk. If bcfg2 is running in paranoid mode, it will 'fail' to make a backup of files, simply because they do not exist, and fail to create the ConfigFile?.

Installing ConfigFile /etc/apache2/sites-include/rt
> cp /etc/apache2/sites-include/rt /var/cache/bcfg2/_etc_apache2_sites-include_rt
< cp: cannot stat `/etc/apache2/sites-include/rt': No such file or directory
Failed to create backup file for ConfigFile /etc/apache2/sites-include/rt

Looks like the problem is in line ~404 of Server/Tools?/ My python is weak and I still find the bcfg2 source scary, but this is a crappy way to do it better:

         # If we get here, then the parent directory should exist
        if entry.get("paranoid", False) and self.setup.get("paranoid", False):
            bkupnam = entry.get('name').replace('/', '_')
                if"cp %s /var/cache/bcfg2/%s" % (entry.get('name'), bkupnam))[0]:
                    self.logger.error("Failed to create backup file for ConfigFile %s" % \
                    return False
                self.logger.debug("%s does not exist, skipping backup." % entry.get('name'))


Change History

comment:1 Changed 15 years ago by desai

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r4585

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.