Fixes "is not" usage

Fixes bug #1110973

Change-Id: I68451ce32f3036e43a2bf1f59a02b392a9e40d6d
This commit is contained in:
Zhongyue Luo 2013-01-31 10:08:11 +08:00
parent 4de4877f74
commit e228035f44
5 changed files with 7 additions and 7 deletions

View File

@ -407,7 +407,7 @@ class CloudController(object):
def describe_key_pairs(self, context, key_name=None, **kwargs):
key_pairs = self.keypair_api.get_key_pairs(context, context.user_id)
if not key_name is None:
if key_name is not None:
key_pairs = [x for x in key_pairs if x['name'] in key_name]
#If looking for non existent key pair

View File

@ -70,7 +70,7 @@ class Client(object):
def add(self, key, value, time=0, min_compress_len=0):
"""Sets the value for a key if it doesn't exist."""
if not self.get(key) is None:
if self.get(key) is not None:
return False
return self.set(key, value, time, min_compress_len)

View File

@ -399,12 +399,12 @@ def fake_instance_get_all_by_filters(num_servers=5, **kwargs):
server = stub_instance(id=i + 1, uuid=uuid,
**kwargs)
servers_list.append(server)
if not marker is None and uuid == marker:
if marker is not None and uuid == marker:
found_marker = True
servers_list = []
if not marker is None and not found_marker:
if marker is not None and not found_marker:
raise exc.MarkerNotFound(marker=marker)
if not limit is None:
if limit is not None:
servers_list = servers_list[:limit]
return servers_list
return _return_servers

View File

@ -628,7 +628,7 @@ class DynamicLoopingCall(LoopingCallBase):
if not self._running:
break
if not periodic_interval_max is None:
if periodic_interval_max is not None:
idle = min(idle, periodic_interval_max)
LOG.debug(_('Periodic task processor sleeping for %.02f '
'seconds'), idle)

View File

@ -464,7 +464,7 @@ class ImageCacheManager(object):
# _verify_checksum returns True if the checksum is ok, and None if
# there is no checksum file
checksum_result = self._verify_checksum(img_id, base_file)
if not checksum_result is None:
if checksum_result is not None:
image_bad = not checksum_result
# Give other threads a chance to run