diff options
author | Tim Laszlo <tim.laszlo@gmail.com> | 2012-05-23 12:50:33 -0500 |
---|---|---|
committer | Tim Laszlo <tim.laszlo@gmail.com> | 2012-05-23 12:52:10 -0500 |
commit | c424ca4cacae14e5007dc436245fb18fe3591075 (patch) | |
tree | fcdd9980337b0cd3e90f04aa1d70f0d6d8906a94 /src/lib | |
parent | 0c50c4f64c085d53785289aaa95982bc6c2cbf7b (diff) | |
download | bcfg2-c424ca4cacae14e5007dc436245fb18fe3591075.tar.gz bcfg2-c424ca4cacae14e5007dc436245fb18fe3591075.tar.bz2 bcfg2-c424ca4cacae14e5007dc436245fb18fe3591075.zip |
bcfg2-admin: Logging broken for reports
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Bcfg2/Server/Admin/Reports.py | 13 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Reports/updatefix.py | 3 |
2 files changed, 3 insertions, 13 deletions
diff --git a/src/lib/Bcfg2/Server/Admin/Reports.py b/src/lib/Bcfg2/Server/Admin/Reports.py index d38889b52..041eacccc 100644 --- a/src/lib/Bcfg2/Server/Admin/Reports.py +++ b/src/lib/Bcfg2/Server/Admin/Reports.py @@ -79,8 +79,6 @@ class Reports(Bcfg2.Server.Admin.Mode): __longhelp__ = (__shorthelp__) django_commands = ['syncdb', 'sqlall', 'validate'] __usage__ = ("bcfg2-admin reports [command] [options]\n" - " -v|--verbose Be verbose\n" - " -q|--quiet Print only errors\n" "\n" " Commands:\n" " init Initialize the database\n" @@ -100,7 +98,6 @@ class Reports(Bcfg2.Server.Admin.Mode): def __init__(self, setup): Bcfg2.Server.Admin.Mode.__init__(self, setup) - self.log.setLevel(logging.INFO) def __call__(self, args): Bcfg2.Server.Admin.Mode.__call__(self, args) @@ -108,14 +105,6 @@ class Reports(Bcfg2.Server.Admin.Mode): print(self.__usage__) raise SystemExit(0) - verb = 0 - - if '-v' in args or '--verbose' in args: - self.log.setLevel(logging.DEBUG) - verb = 1 - if '-q' in args or '--quiet' in args: - self.log.setLevel(logging.WARNING) - # FIXME - dry run if args[0] in self.django_commands: @@ -141,7 +130,7 @@ class Reports(Bcfg2.Server.Admin.Mode): if clients_file[0] == '-': self.errExit("Invalid clients file: %s" % clients_file) i = i + 1 - self.load_stats(stats_file, clients_file, verb, quick) + self.load_stats(stats_file, clients_file, self.log.getEffectiveLevel() > logging.WARNING, quick) elif args[0] == 'purge': expired = False client = None diff --git a/src/lib/Bcfg2/Server/Reports/updatefix.py b/src/lib/Bcfg2/Server/Reports/updatefix.py index 61029c6fd..68d333dfb 100644 --- a/src/lib/Bcfg2/Server/Reports/updatefix.py +++ b/src/lib/Bcfg2/Server/Reports/updatefix.py @@ -312,9 +312,10 @@ def update_database(): know_version = know_version[0] logger.debug("Presently at %s" % know_version) if know_version.version < lastversion: + logger.info("upgrading database") new_version = rollupdate(know_version.version) if new_version: - logger.debug("upgraded to %s" % new_version) + logger.info("upgraded to %s" % new_version) except: logger.error("Error while updating the database") for x in traceback.format_exc().splitlines(): |