diff --git a/.pylintrc b/.pylintrc index c738c547c1..d0775cbe6a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -48,7 +48,6 @@ disable= global-statement, global-variable-not-assigned, logging-not-lazy, - lost-exception, no-init, non-parent-init-called, pointless-string-statement, diff --git a/neutron/api/v2/attributes.py b/neutron/api/v2/attributes.py index 83471f946e..88ab7cb975 100644 --- a/neutron/api/v2/attributes.py +++ b/neutron/api/v2/attributes.py @@ -151,19 +151,17 @@ def _validate_no_whitespace(data): def _validate_mac_address(data, valid_values=None): - valid_mac = False try: valid_mac = netaddr.valid_mac(_validate_no_whitespace(data)) except Exception: - pass - finally: - # TODO(arosen): The code in this file should be refactored - # so it catches the correct exceptions. _validate_no_whitespace - # raises AttributeError if data is None. - if valid_mac is False: - msg = _("'%s' is not a valid MAC address") % data - LOG.debug(msg) - return msg + valid_mac = False + # TODO(arosen): The code in this file should be refactored + # so it catches the correct exceptions. _validate_no_whitespace + # raises AttributeError if data is None. + if not valid_mac: + msg = _("'%s' is not a valid MAC address") % data + LOG.debug(msg) + return msg def _validate_mac_address_or_none(data, valid_values=None):