diff options
-rw-r--r-- | ipalib/plugins/baseldap.py | 2 | ||||
-rw-r--r-- | ipapython/certmonger.py | 14 | ||||
-rwxr-xr-x | ipatests/i18n.py | 4 |
3 files changed, 13 insertions, 7 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 03a255ca1..ffc0008a6 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -451,12 +451,12 @@ def remove_external_post_callback(ldap, dn, entry_attrs, failed, completed, # Run through the failures and gracefully remove any member defined # as an external member. + completed_external = 0 if memberattr in failed and membertype in failed[memberattr]: entry_attrs_ = ldap.get_entry(dn, [externalattr]) dn = entry_attrs_.dn external_entries = entry_attrs_.get(externalattr, []) failed_entries = [] - completed_external = 0 for entry in failed[memberattr][membertype]: membername = entry[0].lower() diff --git a/ipapython/certmonger.py b/ipapython/certmonger.py index f89ca0b7a..effb7bb15 100644 --- a/ipapython/certmonger.py +++ b/ipapython/certmonger.py @@ -318,8 +318,11 @@ def request_cert(nssdb, nickname, subject, principal, passwd_fname=None): if result[0]: request = _cm_dbus_object(cm.bus, cm, result[1], DBUS_CM_REQUEST_IF, DBUS_CM_IF, True) - except TypeError: - root_logger.error('Failed to get create new request.') + else: + raise RuntimeError('add_request() returned False') + except Exception as e: + root_logger.error('Failed to create a new request: {error}' + .format(error=e)) raise return request.obj_if.get_nickname() @@ -356,8 +359,11 @@ def start_tracking(nickname, secdir, password_file=None, command=None): if result[0]: request = _cm_dbus_object(cm.bus, cm, result[1], DBUS_CM_REQUEST_IF, DBUS_CM_IF, True) - except TypeError as e: - root_logger.error('Failed to add new request.') + else: + raise RuntimeError('add_request() returned False') + except Exception as e: + root_logger.error('Failed to add new request: {error}' + .format(error=e)) raise return request.prop_if.Get(DBUS_CM_REQUEST_IF, 'nickname') diff --git a/ipatests/i18n.py b/ipatests/i18n.py index a83c5806e..368712599 100755 --- a/ipatests/i18n.py +++ b/ipatests/i18n.py @@ -755,7 +755,7 @@ def main(): print('ERROR: no mode specified', file=sys.stderr) return 1 - if options.mode == 'validate_pot' or options.mode == 'validate_po': + if options.mode in ('validate_pot', 'validate_po'): if options.mode == 'validate_pot': files = args if not files: @@ -795,7 +795,7 @@ def main(): else: return 0 - elif options.mode == 'create_test' or 'test_gettext': + elif options.mode in ('create_test', 'test_gettext'): po_file = '%s.po' % options.test_lang pot_file = options.pot_file |