From 88ccade9d5700db881f2ffc53e4a48a76e92c2db Mon Sep 17 00:00:00 2001 From: lzyeval Date: Sat, 31 Dec 2011 12:23:56 +0800 Subject: PEP8 type comparison cleanup Fixes bug #910295 The None, True, and False values are singletons. All variable *comparisons* to singletons should use 'is' or 'is not'. All variable *evaluations* to boolean should use 'if' or 'if not'. "== None", "== True", "== False", and "!= None" comparisons in sqlalchemy's where(), or_(), filter(), and_(), and select() functions should not be changed. Incorrect comparisons or evaluations in comments were not changed. Change-Id: I087f0883bf115b5fe714ccfda86a794b9b2a87f7 --- bin/nova-manage | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/nova-manage b/bin/nova-manage index 7ac365950..a61b5c1dd 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -1605,7 +1605,7 @@ class VsaDriveTypeCommands(object): if name is not None: search_opts['extra_specs']['name'] = name - if all == False: + if not all: search_opts['extra_specs']['visible'] = '1' drives = volume_types.get_all_types(self.context, @@ -1973,7 +1973,7 @@ class StorageManagerCommands(object): ctxt = context.get_admin_context() try: - if flavor == None: + if flavor is None: flavors = db.sm_flavor_get_all(ctxt) else: flavors = db.sm_flavor_get(ctxt, flavor) @@ -2015,7 +2015,7 @@ class StorageManagerCommands(object): ctxt = context.get_admin_context() try: - if backend_conf_id == None: + if backend_conf_id is None: backends = db.sm_backend_conf_get_all(ctxt) else: backends = db.sm_backend_conf_get(ctxt, backend_conf_id) @@ -2075,7 +2075,7 @@ class StorageManagerCommands(object): print '(WARNING: Creating will destroy all data on backend!!!)' c = raw_input('Proceed? (y/n) ') if c == 'y' or c == 'Y': - if flavor_label == None: + if flavor_label is None: print "error: backend needs to be associated with flavor" sys.exit(2) -- cgit