summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-10-17 13:05:24 +0200
committerRob Crittenden <rcritten@redhat.com>2012-10-18 21:10:27 -0400
commit3488770fe98e2ed59b4611dfe356ba9b6f22a2b3 (patch)
tree0f685aef9826a0a821f35721601f9aaba38a3699
parent5f95fbfad2729e59d67730d2d476befa4e0a2e02 (diff)
downloadfreeipa-3488770fe98e2ed59b4611dfe356ba9b6f22a2b3.tar.gz
freeipa-3488770fe98e2ed59b4611dfe356ba9b6f22a2b3.tar.xz
freeipa-3488770fe98e2ed59b4611dfe356ba9b6f22a2b3.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
-rw-r--r--freeipa.spec.in5
-rw-r--r--install/tools/ipa-upgradeconfig15
-rw-r--r--install/tools/man/ipa-upgradeconfig.84
3 files changed, 20 insertions, 4 deletions
diff --git a/freeipa.spec.in b/freeipa.spec.in
index 060f09b12..916630029 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -493,7 +493,7 @@ if [ $1 = 1 ]; then
fi
%endif
if [ $1 -gt 1 ] ; then
- /usr/sbin/ipa-upgradeconfig >/dev/null 2>&1 || :
+ /usr/sbin/ipa-upgradeconfig --quiet >/dev/null || :
fi
%posttrans server
@@ -815,6 +815,9 @@ fi
%ghost %attr(0644,root,apache) %config(noreplace) %{_sysconfdir}/ipa/ca.crt
%changelog
+* Wed Oct 17 2012 Martin Kosek <mkosek@redhat.com> - 2.99.0-51
+- Print ipa-upgradeconfig errors during RPM update
+
* Wed Oct 10 2012 Alexander Bokovoy <abokovoy@redhat.com> - 2.99.0-50
- Make sure server-trust-ad subpackage alternates winbind_krb5_locator.so
plugin to /dev/null since they cannot be used when trusts are configured
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