diff options
author | James Yang <jjyang@mcs.anl.gov> | 2008-08-06 21:41:53 +0000 |
---|---|---|
committer | James Yang <jjyang@mcs.anl.gov> | 2008-08-06 21:41:53 +0000 |
commit | fe5285d55f2138413b17a2be38841a64d88bdbea (patch) | |
tree | f534349166e8e4ed0563f3a935503db1737ed32b /src/sbin | |
parent | 5735fe65678317a1da36dcd338aa30fd03e23960 (diff) | |
download | bcfg2-fe5285d55f2138413b17a2be38841a64d88bdbea.tar.gz bcfg2-fe5285d55f2138413b17a2be38841a64d88bdbea.tar.bz2 bcfg2-fe5285d55f2138413b17a2be38841a64d88bdbea.zip |
fixed minor issues involving -e and -b in bcfg2-reports
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4864 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin')
-rwxr-xr-x | src/sbin/bcfg2 | 3 | ||||
-rwxr-xr-x | src/sbin/bcfg2-reports | 9 | ||||
-rwxr-xr-x | src/sbin/bcfg2-server | 5 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2 index 6f7612b0b..42371009f 100755 --- a/src/sbin/bcfg2 +++ b/src/sbin/bcfg2 @@ -120,6 +120,7 @@ class Client: 'decision-list': DECISION_LIST, 'encoding': Bcfg2.Options.ENCODING, 'omit-lock-check': Bcfg2.Options.OMIT_LOCK_CHECK, + 'filelog': Bcfg2.Options.LOGGING_FILE_PATH, } self.setup = Bcfg2.Options.OptionParser(optinfo) @@ -134,7 +135,7 @@ class Client: level = 20 if self.setup['debug']: level = 0 - Bcfg2.Logger.setup_logging('bcfg2', to_syslog=False, level=level) + Bcfg2.Logger.setup_logging('bcfg2', to_syslog=False, level=level, to_file=self.setup['filelog']) self.logger = logging.getLogger('bcfg2') self.logger.debug(self.setup) if 'drivers' in self.setup and self.setup['drivers'] == 'help': diff --git a/src/sbin/bcfg2-reports b/src/sbin/bcfg2-reports index 1e64669e8..fdc9989d0 100755 --- a/src/sbin/bcfg2-reports +++ b/src/sbin/bcfg2-reports @@ -88,9 +88,9 @@ def print_fields(fields, cli, max_name, entrydict): print display def print_entry(item, max_name): - fmt = ("%%-%dx " % (max_name)) - fdata = [item.name, item.kind] - dispplay = fmt % tuple(fdata) + fmt = ("%%-%ds " % (max_name)) + fdata = item.kind + ":" + item.name + display = fmt % (fdata) print display fields = "" @@ -120,7 +120,7 @@ for option in opts: extraentry = option[1] if option[0] == '-x': expire = option[1] - if option[0] == '-s': + if option[0] == '-s' or option[0] == '-b' or option[0] == '-e': singlehost = option[1] if expire != "": @@ -255,7 +255,6 @@ else: else: for c_inst in c_list: result.append(c_inst) - max_name = -1 if 'name' in fields: for c_inst in result: diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server index d58c8b45e..ba438a07d 100755 --- a/src/sbin/bcfg2-server +++ b/src/sbin/bcfg2-server @@ -208,6 +208,7 @@ if __name__ == '__main__': 'passwd' : Bcfg2.Options.SERVER_PASSWORD, 'static' : Bcfg2.Options.SERVER_STATIC, 'encoding' : Bcfg2.Options.ENCODING, + 'filelog' : Bcfg2.Options.LOGGING_FILE_PATH, }) @@ -217,10 +218,10 @@ if __name__ == '__main__': level = 0 if setup['daemon']: - Bcfg2.Logger.setup_logging('bcfg2-server', to_console=False, level=level) + Bcfg2.Logger.setup_logging('bcfg2-server', to_console=False, level=level, to_file=setup['filelog']) Bcfg2.Daemon.daemonize(setup['daemon']) else: - Bcfg2.Logger.setup_logging('bcfg2-server', level=level) + Bcfg2.Logger.setup_logging('bcfg2-server', level=level, to_file=setup['filelog']) if not setup['key']: print "No key specified in '%s'" % setup['configfile'] |