diff options
author | Martin Kosek <mkosek@redhat.com> | 2012-10-17 13:05:24 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2012-10-18 21:10:17 -0400 |
commit | a5ec992ed97d0f7c3c03ca6d1c54e2370d898526 (patch) | |
tree | 66bb02a284f43bebc723051cd11aa20599542c2b /install/tools | |
parent | 9126b18d8bbf7d8f0f8981deb84f80f2eaa27bfe (diff) | |
download | freeipa-a5ec992ed97d0f7c3c03ca6d1c54e2370d898526.tar.gz freeipa-a5ec992ed97d0f7c3c03ca6d1c54e2370d898526.tar.xz freeipa-a5ec992ed97d0f7c3c03ca6d1c54e2370d898526.zip |
Report ipa-upgradeconfig errors during RPM upgrade
Report errors just like with ipa-ldap-updater. These messages should warn
user that some parts of the upgrades may have not been successful and
he should follow up on them. Otherwise, user may not notice them at all.
ipa-upgradeconfig now has a new --quiet option to make it output only error
level log messages or higher. ipa-upgradeconfig run without options still
pring INFO log messages as it can provide a clean overview about its
actions (unlike ipa-ldap-updater).
https://fedorahosted.org/freeipa/ticket/3157
Diffstat (limited to 'install/tools')
-rw-r--r-- | install/tools/ipa-upgradeconfig | 15 | ||||
-rw-r--r-- | install/tools/man/ipa-upgradeconfig.8 | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/install/tools/ipa-upgradeconfig b/install/tools/ipa-upgradeconfig index 384261498..14d4e0829 100644 --- a/install/tools/ipa-upgradeconfig +++ b/install/tools/ipa-upgradeconfig @@ -61,6 +61,9 @@ def parse_options(): parser = IPAOptionParser(version=version.VERSION) parser.add_option("-d", "--debug", dest="debug", action="store_true", default=False, help="print debugging information") + parser.add_option("-q", "--quiet", dest="quiet", + action="store_true", + default=False, help="Output only errors") options, args = parser.parse_args() safe_options = parser.get_safe_opts(options) @@ -577,9 +580,15 @@ def main(): safe_options, options = parse_options() - standard_logging_setup('/var/log/ipaupgrade.log', verbose=True, - debug=options.debug, console_format='%(message)s', - filemode='a') + verbose = not options.quiet + if options.debug: + console_format = '%(levelname)s: %(message)s' + else: + console_format = '%(message)s' + + 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)) fstore = sysrestore.FileStore('/var/lib/ipa/sysrestore') diff --git a/install/tools/man/ipa-upgradeconfig.8 b/install/tools/man/ipa-upgradeconfig.8 index 740ec554a..43e2ab90e 100644 --- a/install/tools/man/ipa-upgradeconfig.8 +++ b/install/tools/man/ipa-upgradeconfig.8 @@ -30,8 +30,12 @@ It also will convert a CA configured to be accessible via ports 9443, 9444, 9445 This is not intended to be run by an end\-user. It is executed when the IPA rpms are upgraded. This must be run as the root user. .SH "OPTIONS" +.TP \fB\-d\fR, \fB\-\-debug\fR Enable debug logging when more verbose output is needed +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Output only errors .SH "EXIT STATUS" 0 if the update was successful or there was nothing to do |