mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix: catch Exception instead of more specific exception types
Regression caused by commit 491447cc5a
,
ValueErrori and AttributeError are too much specific for these cases, multiple types of
exception can be raised.
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
parent
c204290038
commit
d1e29fe60e
@ -565,7 +565,7 @@ class stageuser_activate(LDAPQuery):
|
|||||||
try:
|
try:
|
||||||
v.decode('utf-8')
|
v.decode('utf-8')
|
||||||
self.log.debug("merge: %s:%r wiped" % (attr, v))
|
self.log.debug("merge: %s:%r wiped" % (attr, v))
|
||||||
except ValueError:
|
except Exception:
|
||||||
self.log.debug("merge %s: [no_print %s]" % (attr, v.__class__.__name__))
|
self.log.debug("merge %s: [no_print %s]" % (attr, v.__class__.__name__))
|
||||||
if isinstance(entry_to[attr], (list, tuple)):
|
if isinstance(entry_to[attr], (list, tuple)):
|
||||||
# multi value attribute
|
# multi value attribute
|
||||||
@ -581,7 +581,7 @@ class stageuser_activate(LDAPQuery):
|
|||||||
try:
|
try:
|
||||||
v.decode('utf-8')
|
v.decode('utf-8')
|
||||||
self.log.debug("Add: %s:%r" % (attr, v))
|
self.log.debug("Add: %s:%r" % (attr, v))
|
||||||
except ValueError:
|
except Exception:
|
||||||
self.log.debug("Add %s: [no_print %s]" % (attr, v.__class__.__name__))
|
self.log.debug("Add %s: [no_print %s]" % (attr, v.__class__.__name__))
|
||||||
|
|
||||||
if isinstance(entry_to[attr], (list, tuple)):
|
if isinstance(entry_to[attr], (list, tuple)):
|
||||||
|
@ -160,7 +160,7 @@ def __parse_config(discover_server = True):
|
|||||||
try:
|
try:
|
||||||
if not config.default_realm:
|
if not config.default_realm:
|
||||||
config.default_realm = p.get("global", "realm")
|
config.default_realm = p.get("global", "realm")
|
||||||
except AttributeError:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
if discover_server:
|
if discover_server:
|
||||||
try:
|
try:
|
||||||
@ -172,7 +172,7 @@ def __parse_config(discover_server = True):
|
|||||||
try:
|
try:
|
||||||
if not config.default_domain:
|
if not config.default_domain:
|
||||||
config.default_domain = p.get("global", "domain")
|
config.default_domain = p.get("global", "domain")
|
||||||
except AttributeError:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def __discover_config(discover_server = True):
|
def __discover_config(discover_server = True):
|
||||||
|
Loading…
Reference in New Issue
Block a user