Exception cleanup
Do not write "except:", use "except Exception:" at the very least Change-Id: I539c013132309791f18c46819232102e9232e917
This commit is contained in:
@@ -2308,7 +2308,7 @@ def main():
|
||||
print "Could not read %s. Re-running with sudo" % flagfile
|
||||
try:
|
||||
os.execvp('sudo', ['sudo', '-u', '#%s' % st.st_uid] + sys.argv)
|
||||
except:
|
||||
except Exception:
|
||||
print 'sudo failed, continuing as if nothing happened'
|
||||
|
||||
argv = FLAGS(sys.argv)
|
||||
|
@@ -111,7 +111,7 @@ class SolidFireVolumeTestCase(test.TestCase):
|
||||
try:
|
||||
sfv.create_volume(testvol)
|
||||
self.fail("Should have thrown Error")
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def test_create_sfaccount(self):
|
||||
@@ -155,7 +155,7 @@ class SolidFireVolumeTestCase(test.TestCase):
|
||||
try:
|
||||
model_update = sfv.delete_volume(testvol)
|
||||
self.fail("Should have thrown Error")
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def test_delete_volume_fails_account_lookup(self):
|
||||
|
@@ -1522,7 +1522,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
try:
|
||||
raise NotImplementedError('test')
|
||||
except:
|
||||
except Exception:
|
||||
exc_info = sys.exc_info()
|
||||
|
||||
self.stubs.Set(nova.db, 'instance_fault_create', fake_db_fault_create)
|
||||
@@ -1550,7 +1550,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
try:
|
||||
raise user_exc
|
||||
except:
|
||||
except Exception:
|
||||
exc_info = sys.exc_info()
|
||||
|
||||
self.stubs.Set(nova.db, 'instance_fault_create', fake_db_fault_create)
|
||||
|
Reference in New Issue
Block a user