Skip to content

Commit

Permalink
Merge "PEP8 python-novaclient cleanup"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Jan 10, 2012
2 parents 8651e97 + 4ff2770 commit c747f15
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -37,3 +37,4 @@ Robie Basak <robie.basak@canonical.com>
Sandy Walsh <sandy@darksecretsoftware.com>
Unmesh Gurjar <unmesh.gurjar@vertex.co.in>
William Wolf <throughnothing@gmail.com>
Zhongyue Luo <lzyeval@gmail.com>
2 changes: 1 addition & 1 deletion novaclient/base.py
Expand Up @@ -74,7 +74,7 @@ def _list(self, url, response_key, obj_class=None, body=None):
data = body[response_key]
# NOTE(ja): keystone returns values as list as {'values': [ ... ]}
# unlike other services which just return the list...
if type(data) is dict:
if isinstance(data, dict):
try:
data = data['values']
except KeyError:
Expand Down
2 changes: 1 addition & 1 deletion novaclient/client.py
Expand Up @@ -192,7 +192,7 @@ def authenticate(self):
magic_tuple = urlparse.urlsplit(self.auth_url)
scheme, netloc, path, query, frag = magic_tuple
port = magic_tuple.port
if port == None:
if port is None:
port = 80
path_parts = path.split('/')
for part in path_parts:
Expand Down
2 changes: 1 addition & 1 deletion novaclient/v1_1/quotas.py
Expand Up @@ -51,7 +51,7 @@ def update(self, tenant_id, metadata_items=None,
'cores': cores}}

for key in body['quota_set'].keys():
if body['quota_set'][key] == None:
if body['quota_set'][key] is None:
body['quota_set'].pop(key)

self._update('/os-quota-sets/%s' % (tenant_id), body)
Expand Down
4 changes: 2 additions & 2 deletions novaclient/v1_1/shell.py
Expand Up @@ -503,7 +503,7 @@ def do_rebuild(cs, args):
server = _find_server(cs, args.server)
image = _find_image(cs, args.image)

if args.rebuild_password != False:
if args.rebuild_password is not False:
_password = args.rebuild_password
else:
_password = None
Expand Down Expand Up @@ -1054,7 +1054,7 @@ def __init__(self, obj):
elif k == 'group':
k = 'source_group'
v = v.get('name')
if v == None:
if v is None:
v = ''

setattr(self, k, v)
Expand Down

0 comments on commit c747f15

Please sign in to comment.