Do not write except:, use except Exception instead
Follow the hacking: http://docs.openstack.org/developer/hacking. Do not write except:, use except Exception: at the very least. When catching an exception you should be as specific so you don’t mistakenly catch unexpected exceptions.This patch is to fix it. Change-Id: Iefdc52e7ad87a51b79ac1fa1175f7b62e6d8eb4f Closes-Bug: #1600714
This commit is contained in:
@@ -39,7 +39,7 @@ def validate_ref(ref, entity):
|
||||
try:
|
||||
_, entity_uuid = ref.rstrip('/').rsplit('/', 1)
|
||||
uuid.UUID(entity_uuid)
|
||||
except:
|
||||
except Exception:
|
||||
raise ValueError('{0} incorrectly specified.'.format(entity))
|
||||
|
||||
return True
|
||||
|
||||
@@ -236,7 +236,7 @@ class KeystoneClientFixture(testtools.TestCase):
|
||||
|
||||
try:
|
||||
self.barbican.run(argv=argv)
|
||||
except:
|
||||
except Exception:
|
||||
self.fail('failed to delete secret')
|
||||
|
||||
def test_v2_auth(self):
|
||||
|
||||
Reference in New Issue
Block a user