summaryrefslogtreecommitdiffstats
path: root/generators
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2004-08-09 19:57:51 +0000
committerNarayan Desai <desai@mcs.anl.gov>2004-08-09 19:57:51 +0000
commit576a8c83a3297b1d4404373b977d6e5e6325cf1f (patch)
tree6bb62ea0aeaef305a5a6d3d6b0bb1e01e6e07a4e /generators
parentb8199cdc1989e2c1220e9162f904ea2c3e49b8a7 (diff)
downloadbcfg2-576a8c83a3297b1d4404373b977d6e5e6325cf1f.tar.gz
bcfg2-576a8c83a3297b1d4404373b977d6e5e6325cf1f.tar.bz2
bcfg2-576a8c83a3297b1d4404373b977d6e5e6325cf1f.zip
update to include image-specific fragments
(Logical change 1.26) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@127 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'generators')
-rw-r--r--generators/cfg.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/generators/cfg.py b/generators/cfg.py
index d76be9e92..fc9385d40 100644
--- a/generators/cfg.py
+++ b/generators/cfg.py
@@ -26,7 +26,7 @@ class FileEntry(FileBacked):
return self.metadata.__cmp__(other.metadata)
class ConfigFileEntry(object):
- mx = compile("(^(?P<filename>.*)(\.((B(?P<bprio>\d+)_(?P<bundle>\S+))|(T(?P<tprio>\d+)_(?P<tag>\S+))(I(?P<iprio>\d+)_(?P<image>\S+))|(H_(?P<hostname>\S+)))(\.(?P<op>cat|udiff))?)?$)")
+ 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+)$')
def __init__(self, path):
@@ -66,14 +66,17 @@ class ConfigFileEntry(object):
return
data = {}
- for attr in ['bundle', 'tag', 'hostname']:
+ for attr in ['bundle', 'attr', 'hostname', 'class']:
if g.group(attr) != None: data[attr] = g.group(attr)
if data == {}:
all = True
else:
all = False
- arg = (all, 'linux') + tuple(map(lambda z:filter(lambda x:x, [data.get(z, None)]), ['bundle','tag'])) + \
- (data.get("hostname",None), )
+ # metadata args (global, image, classes, bundles, attributes, hostname)
+ arg = (all, data.get('image', None))
+ for mtype in ['class', 'bundle', 'attr']:
+ arg = arg + (data.get(mtype, []),)
+ arg = arg + (data.get('hostname', None),)
m = apply(Metadata, arg)
if g.group("op") != None:
self.deltas.append(FileEntry(name, m))