Exception cleanup

Do not write "except:", use "except Exception:" at the very least

Change-Id: I539c013132309791f18c46819232102e9232e917
This commit is contained in:
Joe Gordon
2012-02-21 00:10:04 -08:00
parent 184340290c
commit f0824ec7c6
3 changed files with 5 additions and 5 deletions

View File

@@ -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)

View File

@@ -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):

View File

@@ -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)