summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg2-reports12
-rwxr-xr-xsrc/sbin/bcfg2-test9
2 files changed, 14 insertions, 7 deletions
diff --git a/src/sbin/bcfg2-reports b/src/sbin/bcfg2-reports
index 9f2ff96c2..2c4a918be 100755
--- a/src/sbin/bcfg2-reports
+++ b/src/sbin/bcfg2-reports
@@ -10,7 +10,7 @@ from Bcfg2.Compat import ConfigParser
try:
import Bcfg2.settings
except ConfigParser.NoSectionError:
- print("Your bcfg2.conf is currently missing the statistics section which "
+ print("Your bcfg2.conf is currently missing the [database] section which "
"is necessary for the reporting interface. Please see bcfg2.conf(5) "
"for more details.")
sys.exit(1)
@@ -121,7 +121,7 @@ def main():
help="Show hosts that haven't run in the last 24 "
"hours")
parser.add_option_group(allhostmodes)
-
+
# entry modes
entrymodes = \
OptionGroup(parser, "Entry Modes",
@@ -166,7 +166,7 @@ def main():
(mode.get_opt_string(), opt.get_opt_string()))
mode = opt
mode_family = parser.get_option_group(opt.get_opt_string())
-
+
# you can specify more than one of --bad, --extra, --modified, --show, so
# consider single-host options separately
if not mode_family:
@@ -174,7 +174,7 @@ def main():
if getattr(options, opt.dest):
mode_family = parser.get_option_group(opt.get_opt_string())
break
-
+
if not mode_family:
parser.error("You must specify a mode")
@@ -243,7 +243,7 @@ def main():
parser.error("%s require either a list of entries on the "
"command line or the --file options" %
mode_family.title)
-
+
if options.badentry:
result = hosts_by_entry_type(clients, "bad", entries)
elif options.modifiedentry:
@@ -263,7 +263,7 @@ def main():
# todo batch fetch this. sqlite could break
for client in clients:
- ents = entry_cls.objects.filter(name=entries[0][1],
+ ents = entry_cls.objects.filter(name=entries[0][1],
interaction=client.current_interaction)
if len(ents) == 0:
continue
diff --git a/src/sbin/bcfg2-test b/src/sbin/bcfg2-test
index 4a57fa42f..6eaf0cc33 100755
--- a/src/sbin/bcfg2-test
+++ b/src/sbin/bcfg2-test
@@ -128,7 +128,14 @@ class ClientTest(TestCase):
"\n".join(output + ["Configuration is missing bundle(s): %s" %
':'.join(missing)])
- # check for render failures
+ # check for unknown packages
+ unknown_pkgs = [el.get("name")
+ for el in config.xpath('//Package[@type="unknown"]')
+ if not self.ignore_entry(el.tag, el.get("name"))]
+ assert len(unknown_pkgs) == 0, \
+ "Configuration contains unknown packages: %s" % \
+ ", ".join(unknown_pkgs)
+
failures = []
msg = output + ["Failures:"]
for failure in config.xpath('//*[@failure]'):