diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2004-08-31 14:41:40 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2004-08-31 14:41:40 +0000 |
commit | 20a6d50f39a04b4cf2c73c94734c133eda47341a (patch) | |
tree | 77e4ea669bf26ffdaba96d5801f664d35aa7f78c /src/lib | |
parent | 104a1bc8a0f0989cf1beab87c85e19af16062f3f (diff) | |
download | bcfg2-20a6d50f39a04b4cf2c73c94734c133eda47341a.tar.gz bcfg2-20a6d50f39a04b4cf2c73c94734c133eda47341a.tar.bz2 bcfg2-20a6d50f39a04b4cf2c73c94734c133eda47341a.zip |
add paranoid support to the cfg file repo
(Logical change 1.45)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@270 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Generators/cfg.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/Server/Generators/cfg.py b/src/lib/Server/Generators/cfg.py index 97b0775e1..c79e90c32 100644 --- a/src/lib/Server/Generators/cfg.py +++ b/src/lib/Server/Generators/cfg.py @@ -25,7 +25,7 @@ class FileEntry(FileBacked): class ConfigFileEntry(object): mx = compile("(^(?P<filename>.*)(\.((B(?P<bprio>\d+)_(?P<bundle>\S+))|(A(?P<aprio>\d+)_(?P<attr>\S+))|(I(?P<iprio>\d+)_(?P<image>\S+))|(I(?P<cprio>\d+)_(?P<class>\S+))|(H_(?P<hostname>\S+)))(\.(?P<op>cat|udiff))?)?$)") - info = compile('^owner:(\s)*(?P<owner>\w+)|group:(\s)*(?P<group>\w+)|perms:(\s)*(?P<perms>\w+)|encoding:(\s)*(?P<encoding>\w+)$') + info = compile('^owner:(\s)*(?P<owner>\w+)|group:(\s)*(?P<group>\w+)|perms:(\s)*(?P<perms>\w+)|encoding:(\s)*(?P<encoding>\w+)|(?P<paranoid>paranoid(\s)*)$') def __init__(self, path): self.path = path @@ -35,6 +35,7 @@ class ConfigFileEntry(object): self.owner = 'root' self.group = 'root' self.perms = '644' + self.paranoid = False def GetInfo(self, filename): for line in open(filename).readlines(): @@ -53,6 +54,8 @@ class ConfigFileEntry(object): self.perms=d['perms'] if len(self.perms) == 3: self.perms="0%s"%(self.perms) + elif d['paranoid']: + self.paranoid = True def AddEntry(self, name): if name[-5:] == ':info': @@ -114,6 +117,8 @@ class ConfigFileEntry(object): pass # apply diffs, etc entry.attrib.update({'owner':self.owner, 'group':self.group, 'perms':self.perms, 'encoding':self.encoding}) + if entry.paranoid: + entry.attrib['paranoid'] = 'true' entry.text = filedata class ConfigFileRepository(DirectoryBacked): |