admin tools: Log IPA version

Add the IPA version, and vendor version if applicable, to the beginning
of admintool logs -- both framework and indivitual tools that don't yet
use the framework.
This will make debugging easier.

https://fedorahosted.org/freeipa/ticket/4219

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Petr Viktorin 2014-03-19 13:54:20 +01:00
parent 7f465e693c
commit d6a4da30de
9 changed files with 9 additions and 0 deletions

View File

@ -217,6 +217,7 @@ def main():
root_logger.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
root_logger.debug("missing options might be asked for interactively later\n")
root_logger.debug('IPA version %s' % version.VENDOR_VERSION)
check_server_configuration()

View File

@ -99,6 +99,7 @@ def main():
standard_logging_setup(log_file_name, debug=options.debug)
root_logger.debug('%s was invoked with argument "%s" and options: %s' % (sys.argv[0], filename, safe_options))
root_logger.debug('IPA version %s' % version.VENDOR_VERSION)
if not ipautil.file_exists(filename):
sys.exit("Replica file %s does not exist" % filename)

View File

@ -80,6 +80,7 @@ def main():
root_logger.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
root_logger.debug("missing options might be asked for interactively later\n")
root_logger.debug('IPA version %s' % version.VENDOR_VERSION)
installutils.check_server_configuration()

View File

@ -302,6 +302,7 @@ def main():
logging_setup(options)
root_logger.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
root_logger.debug("missing options might be asked for interactively later\n")
root_logger.debug('IPA version %s' % version.VENDOR_VERSION)
signal.signal(signal.SIGTERM, sigterm_handler)

View File

@ -455,6 +455,7 @@ def main():
standard_logging_setup(log_file_name, debug=options.debug)
root_logger.debug('%s was invoked with argument "%s" and options: %s' % (sys.argv[0], filename, safe_options))
root_logger.debug('IPA version %s' % version.VENDOR_VERSION)
if not ipautil.file_exists(filename):
sys.exit("Replica file %s does not exist" % filename)

View File

@ -607,6 +607,7 @@ def main():
root_logger.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
root_logger.debug("missing options might be asked for interactively later\n")
root_logger.debug('IPA version %s' % version.VENDOR_VERSION)
global fstore
fstore = sysrestore.FileStore(SYSRESTORE_DIR_PATH)

View File

@ -1014,6 +1014,7 @@ def main():
standard_logging_setup('/var/log/ipaupgrade.log', debug=options.debug,
verbose=verbose, console_format=console_format, filemode='a')
root_logger.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
root_logger.debug('IPA version %s' % version.VENDOR_VERSION)
fstore = sysrestore.FileStore('/var/lib/ipa/sysrestore')

View File

@ -2856,6 +2856,7 @@ def main():
root_logger.debug(
'%s was invoked with options: %s', sys.argv[0], safe_options)
root_logger.debug("missing options might be asked for interactively later")
root_logger.debug('IPA version %s' % version.VENDOR_VERSION)
env={"PATH":"/bin:/sbin:/usr/kerberos/bin:/usr/kerberos/sbin:/usr/bin:/usr/sbin"}

View File

@ -283,6 +283,7 @@ class AdminTool(object):
"""
self.log.debug('%s was invoked with arguments %s and options: %s',
self.command_name, self.args, self.safe_options)
self.log.debug('IPA version %s' % version.VENDOR_VERSION)
def log_failure(self, error_message, return_value, exception, backtrace):
self.log.debug(''.join(traceback.format_tb(backtrace)))