diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2010-08-23 16:47:30 +0000 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2010-08-27 08:28:39 -0500 |
commit | b2f66ed8f6325fbe2d2b00887c250501e9e35128 (patch) | |
tree | 54e0c601700a8f9855e36cc6ae76bedf37398d0e | |
parent | 2674ee5dfb5f81d9257e1dcbd5613a9554734bac (diff) | |
download | bcfg2-b2f66ed8f6325fbe2d2b00887c250501e9e35128.tar.gz bcfg2-b2f66ed8f6325fbe2d2b00887c250501e9e35128.tar.bz2 bcfg2-b2f66ed8f6325fbe2d2b00887c250501e9e35128.zip |
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 <sol.jerome@gmail.com>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6033 ce84e21b-d406-0410-9b95-82705330c041
-rwxr-xr-x | src/sbin/bcfg2-repo-validate | 8 |
1 files changed, 6 insertions, 2 deletions
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: |