From 576a8c83a3297b1d4404373b977d6e5e6325cf1f Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Mon, 9 Aug 2004 19:57:51 +0000 Subject: 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 --- generators/cfg.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'generators') 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.*)(\.((B(?P\d+)_(?P\S+))|(T(?P\d+)_(?P\S+))(I(?P\d+)_(?P\S+))|(H_(?P\S+)))(\.(?Pcat|udiff))?)?$)") + mx = compile("(^(?P.*)(\.((B(?P\d+)_(?P\S+))|(A(?P\d+)_(?P\S+))|(I(?P\d+)_(?P\S+))|(I(?P\d+)_(?P\S+))|(H_(?P\S+)))(\.(?Pcat|udiff))?)?$)") info = compile('^owner:(\s)*(?P\w+)|group:(\s)*(?P\w+)|perms:(\s)*(?P\w+)|encoding:(\s)*(?P\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)) -- cgit v1.2.3-1-g7c22