mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 15:40:01 -06:00
py3: Remove py3 incompatible exception handling
https://fedorahosted.org/freeipa/ticket/5585 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
parent
00c13fd340
commit
50627004b8
@ -752,9 +752,9 @@ def run(api):
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print ''
|
print ''
|
||||||
api.log.info('operation aborted')
|
api.log.info('operation aborted')
|
||||||
except PublicError, e:
|
except PublicError as e:
|
||||||
error = e
|
error = e
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
api.log.exception('%s: %s', e.__class__.__name__, str(e))
|
api.log.exception('%s: %s', e.__class__.__name__, str(e))
|
||||||
error = InternalError()
|
error = InternalError()
|
||||||
if error is not None:
|
if error is not None:
|
||||||
|
@ -13,7 +13,7 @@ env._finalize_core(**dict(DEFAULT_CONFIG))
|
|||||||
api.bootstrap(context='server', debug=env.debug, log=None) (ref:wsgi-app-bootstrap)
|
api.bootstrap(context='server', debug=env.debug, log=None) (ref:wsgi-app-bootstrap)
|
||||||
try:
|
try:
|
||||||
api.finalize() (ref:wsgi-app-finalize)
|
api.finalize() (ref:wsgi-app-finalize)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
api.log.error('Failed to start IPA: %s' % e)
|
api.log.error('Failed to start IPA: %s' % e)
|
||||||
else:
|
else:
|
||||||
api.log.info('*** PROCESS START ***')
|
api.log.info('*** PROCESS START ***')
|
||||||
|
@ -138,7 +138,7 @@ class BaseServerCA(common.Installable, core.Group, core.Composite):
|
|||||||
for rdn in dn:
|
for rdn in dn:
|
||||||
if rdn.attr.lower() not in VALID_SUBJECT_ATTRS:
|
if rdn.attr.lower() not in VALID_SUBJECT_ATTRS:
|
||||||
raise ValueError("invalid attribute: \"%s\"" % rdn.attr)
|
raise ValueError("invalid attribute: \"%s\"" % rdn.attr)
|
||||||
except ValueError, e:
|
except ValueError as e:
|
||||||
raise ValueError("invalid subject base format: %s" % e)
|
raise ValueError("invalid subject base format: %s" % e)
|
||||||
|
|
||||||
ca_signing_algorithm = Knob(
|
ca_signing_algorithm = Knob(
|
||||||
@ -243,7 +243,7 @@ class BaseServerDNS(common.Installable, core.Group, core.Composite):
|
|||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
value = value.decode(encoding)
|
value = value.decode(encoding)
|
||||||
bindinstance.validate_zonemgr_str(value)
|
bindinstance.validate_zonemgr_str(value)
|
||||||
except ValueError, e:
|
except ValueError as e:
|
||||||
# FIXME we can do this in better way
|
# FIXME we can do this in better way
|
||||||
# https://fedorahosted.org/freeipa/ticket/4804
|
# https://fedorahosted.org/freeipa/ticket/4804
|
||||||
# decode to proper stderr encoding
|
# decode to proper stderr encoding
|
||||||
|
Loading…
Reference in New Issue
Block a user