mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Avoid redundant info message during RPM update
A change to ipa-ldap-updater (and thus an RPM update %post scriptlet) avoiding redundat "IPA is not configured" message in stderr introdocued inc20d4c71b8was reverted in another patch (b5c1ce88a4). Return the change back to avoid this message during every RPM update when IPA is not configured. admintool framework was also fixed to avoid print an empty line when an exception without an error message is raised. https://fedorahosted.org/freeipa/ticket/2892
This commit is contained in:
@@ -212,7 +212,8 @@ class AdminTool(object):
|
||||
self.log
|
||||
except AttributeError:
|
||||
# Logging was not set up yet
|
||||
print >> sys.stderr, '\n', error_message
|
||||
if error_message:
|
||||
print >> sys.stderr, '\n', error_message
|
||||
else:
|
||||
self.info(''.join(traceback.format_tb(backtrace)))
|
||||
self.info('The %s command failed, exception: %s: %s',
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
# save undo files?
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import krbV
|
||||
|
||||
@@ -83,10 +84,14 @@ class LDAPUpdater(admintool.AdminTool):
|
||||
raise admintool.ScriptError("%s: file not found" % filename)
|
||||
|
||||
if os.getegid() == 0:
|
||||
installutils.check_server_configuration()
|
||||
try:
|
||||
installutils.check_server_configuration()
|
||||
except RuntimeError, e:
|
||||
print unicode(e)
|
||||
sys.exit(1)
|
||||
elif not os.path.exists('/etc/ipa/default.conf'):
|
||||
raise admintool.ScriptError(
|
||||
"IPA is not configured on this system.")
|
||||
print "IPA is not configured on this system."
|
||||
sys.exit(1)
|
||||
|
||||
if options.password:
|
||||
pw = ipautil.template_file(options.password, [])
|
||||
|
||||
Reference in New Issue
Block a user