From b2f66ed8f6325fbe2d2b00887c250501e9e35128 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 23 Aug 2010 16:47:30 +0000 Subject: repo-validate: Validate two levels of Group nesting (Fixes Ticket #805) This change forces the validator to check two levels of group nesting so that we don't assume two packages are the same based only on their parent groups. Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6033 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-repo-validate | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sbin/bcfg2-repo-validate b/src/sbin/bcfg2-repo-validate index d187441ed..1c03a7c2b 100755 --- a/src/sbin/bcfg2-repo-validate +++ b/src/sbin/bcfg2-repo-validate @@ -55,7 +55,7 @@ if __name__ == '__main__': included.discard(filename) # check for multiple default group definitions - default_groups=[] + default_groups = [] for grp in lxml.etree.parse("%s/Metadata/groups.xml" \ % repo).findall('.//Group'): if grp.get('default') == 'true': @@ -130,9 +130,13 @@ if __name__ == '__main__': for pkg in xdata.findall("//Package"): if pkg.getparent().tag == 'Group': grp = pkg.getparent().get('name') + if grp.getparent().tag == 'Group': + pgrp = grp.getparent().get('name') + else: + pgrp = 'none' else: grp = 'none' - ptuple = (pkg.get('name'), priority, ptype, grp) + ptuple = (pkg.get('name'), priority, ptype, grp, pgrp) # check if package is already listed with same priority, # type, grp if ptuple in pset: -- cgit v1.2.3-1-g7c22