Ticket #958 (closed defect: fixed)

Opened 12 years ago

Last modified 11 years ago

Paranoid mode has different defaults depending on existance of info.xml

Reported by: Owned by: desai
Priority: major Milestone: Bcfg2 1.2.0 Release
Component: bcfg2-server Version: 1.0
Keywords: Cc:


I have the following setting in my server-side bcfg2.conf:

[mdata] paranoid = true And the following in my client bcfg2.conf: [paranoid] path = /var/cache/bcfg2 max_copies = 5 [client] paranoid = True

Unfortunately, that does _not_ set paranoid mode on all files by default; it only sets paranoid mode on all files that do not have an info.xml (regardless of whether or not that info.xml contains anything at all about paranoid mode). For instance, /etc/yum.conf has an info.xml:

% ls Cfg/etc/yum.conf info.xml yum.conf % cat Cfg/etc/yum.conf/info.xml <FileInfo?>

<Info owner='root' group='root' perms='0644'/>


Yet paranoid mode is not on when I check in a cached config on a client:

# bcfg2 -qnc cached.xml # grep yum.conf cached.xml

</Bundle><Bundle name="yum"><Path name="/etc/yum.conf" owner="root" group="root" perms="0644" type="file">[main]

/etc/my.cnf does not have an info.xml file:

% ls Cfg/etc/my.cnf my.cnf.G00_mysql-master my.cnf.G00_mysql-slave

It is properly flagged as paranoid:

# grep my.cnf cached.xml

<Path name="/etc/my.cnf" owner="root" perms="644" group="root" paranoid="true" type="file">[mysqld]

Basically, setting paranoid=true in the global metadata makes the default paranoid=true if info.xml does not exist, but the default remains paranoid=false if info.xml does exist.

We are running v1.0.1


metadata-defaults.patch (721 bytes) - added by 12 years ago.

Change History

Changed 12 years ago by

comment:1 Changed 12 years ago by

The root of the problem appears to be that handles metadata differently if it comes from info.xml than if it comes from :info or the defaults in bcfg2.conf. Namely, settings in :info just overwrite the defaults already set, but info.xml is processed completely separately.

I've attached a patch that sets defaults from bcfg2.conf before processing settings in either :info or info.xml. It does process _both_ :info and info.xml, treating the latter as higher priority; this might be confusing, but it would be easy enough to make bind_info_to_entry() only respect :info if info.xml didn't exist.

comment:2 Changed 11 years ago by desai

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

Patch committed in [670bce6e830389387742fdee185356bf337673fb]. Thanks.

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.