Ticket #958 (closed defect: fixed)
Paranoid mode has different defaults depending on existance of info.xml
Reported by: | https://www.google.com/accounts/o8/id?id=AItOawnSjgovXZr-_V3vGkvMSR0pc5LDykRc1Nc | Owned by: | desai |
---|---|---|---|
Priority: | major | Milestone: | Bcfg2 1.2.0 Release |
Component: | bcfg2-server | Version: | 1.0 |
Keywords: | Cc: |
Description
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
Attachments
Change History
Changed 13 years ago by https://www.google.com/accounts/o8/id?id=AItOawnSjgovXZr-_V3vGkvMSR0pc5LDykRc1Nc
- Attachment metadata-defaults.patch added
comment:1 Changed 13 years ago by https://www.google.com/accounts/o8/id?id=AItOawnSjgovXZr-_V3vGkvMSR0pc5LDykRc1Nc
The root of the problem appears to be that Plugin.py 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 12 years ago by desai
- Status changed from new to closed
- Resolution set to fixed
Patch committed in [670bce6e830389387742fdee185356bf337673fb]. Thanks.