diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-10-17 10:26:13 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-10-17 10:27:42 -0400 |
commit | 90b1276b8039642f95f5987ff1d0df413454a6d9 (patch) | |
tree | 72b6a65f3e2614d7b9d693e173d683e234fbac0d /src/lib/Bcfg2/Server/Admin/Minestruct.py | |
parent | 6eeded84fca720269d1fda36f785f01ddeb705bb (diff) | |
download | bcfg2-90b1276b8039642f95f5987ff1d0df413454a6d9.tar.gz bcfg2-90b1276b8039642f95f5987ff1d0df413454a6d9.tar.bz2 bcfg2-90b1276b8039642f95f5987ff1d0df413454a6d9.zip |
expanded pylint coverage to Admin modes, removed some old/broken admin modes
Diffstat (limited to 'src/lib/Bcfg2/Server/Admin/Minestruct.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Admin/Minestruct.py | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/lib/Bcfg2/Server/Admin/Minestruct.py b/src/lib/Bcfg2/Server/Admin/Minestruct.py index 2db80f5c5..6d0dab106 100644 --- a/src/lib/Bcfg2/Server/Admin/Minestruct.py +++ b/src/lib/Bcfg2/Server/Admin/Minestruct.py @@ -1,22 +1,17 @@ +""" Extract extra entry lists from statistics """ import getopt import lxml.etree import sys - import Bcfg2.Server.Admin + class Minestruct(Bcfg2.Server.Admin.StructureMode): - """Pull extra entries out of statistics.""" - __shorthelp__ = "Extract extra entry lists from statistics" - __longhelp__ = (__shorthelp__ + - "\n\nbcfg2-admin minestruct [-f filename] " - "[-g groups] client\n") - __usage__ = ("bcfg2-admin minestruct [options] <client>\n\n" + """ Extract extra entry lists from statistics """ + __usage__ = ("[options] <client>\n\n" " %-25s%s\n" " %-25s%s\n" % - ("-f <filename>", - "build a particular file", - "-g <groups>", - "only build config for groups")) + ("-f <filename>", "build a particular file", + "-g <groups>", "only build config for groups")) def __call__(self, args): if len(args) == 0: @@ -25,7 +20,7 @@ class Minestruct(Bcfg2.Server.Admin.StructureMode): try: (opts, args) = getopt.getopt(args, 'f:g:h') except: - self.log.error(self.__shorthelp__) + self.log.error(self.__doc__) raise SystemExit(1) client = args[0] @@ -54,11 +49,10 @@ class Minestruct(Bcfg2.Server.Admin.StructureMode): root = lxml.etree.Element("Base") self.log.info("Found %d extra entries" % (len(extra))) add_point = root - for g in groups: - add_point = lxml.etree.SubElement(add_point, "Group", name=g) + for grp in groups: + add_point = lxml.etree.SubElement(add_point, "Group", name=grp) for tag, name in extra: self.log.info("%s: %s" % (tag, name)) lxml.etree.SubElement(add_point, tag, name=name) - tree = lxml.etree.ElementTree(root) - tree.write(output, pretty_print=True) + lxml.etree.ElementTree(root).write(output, pretty_print=True) |