summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-04-21 20:59:02 -0500
committerSol Jerome <solj@ices.utexas.edu>2010-04-21 21:27:22 -0500
commit6b86e92d058769c465c3514be859700e1b7f98b1 (patch)
tree2a2251adcd4e6fa59ef88f8b740bc3ee3271d9b4
parent71203b95bdb8e05ad25ec408d0afaa8ae55f18c0 (diff)
downloadbcfg2-6b86e92d058769c465c3514be859700e1b7f98b1.tar.gz
bcfg2-6b86e92d058769c465c3514be859700e1b7f98b1.tar.bz2
bcfg2-6b86e92d058769c465c3514be859700e1b7f98b1.zip
bcfg2-repo-validate: Warn when multiple default groups defined (Resolves Ticket #795)
Signed-off-by: Sol Jerome <solj@ices.utexas.edu>
-rwxr-xr-xsrc/sbin/bcfg2-repo-validate8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sbin/bcfg2-repo-validate b/src/sbin/bcfg2-repo-validate
index 1d16a8148..685916fc9 100755
--- a/src/sbin/bcfg2-repo-validate
+++ b/src/sbin/bcfg2-repo-validate
@@ -54,6 +54,14 @@ if __name__ == '__main__':
included.add(ent)
included.discard(filename)
+ # check for multiple default group definitions
+ default_groups = lxml.etree.parse("%s/Metadata/groups.xml" \
+ % repo).findall('.//Group[@default="true"]')
+ if len(default_groups) > 1:
+ print("*** Warning: Multiple default groups defined")
+ for grp in default_groups:
+ print(" %s" % grp.get('name'))
+
# get all XIncluded bundles
xdata.xinclude()
for bundle in xdata.findall("//Bundle"):