PEP8 cleanups of utils, and the v1_?/shell.py files
This commit is contained in:
parent
4443a069ac
commit
690f3d3866
@ -32,7 +32,7 @@ def print_list(objs, fields, formatters={}):
|
||||
else:
|
||||
if field in mixed_case_fields:
|
||||
field_name = field.replace(' ', '_')
|
||||
else:
|
||||
else:
|
||||
field_name = field.lower().replace(' ', '_')
|
||||
data = getattr(o, field_name, '')
|
||||
row.append(data)
|
||||
|
@ -355,8 +355,9 @@ def do_image_list(cs, args):
|
||||
server_list[server.id] = server.name
|
||||
image_list = cs.images.list()
|
||||
for i in range(len(image_list)):
|
||||
if hasattr(image_list[i],'serverId'):
|
||||
image_list[i].serverId = server_list[image_list[i].serverId] + ' (' + str(image_list[i].serverId) + ')'
|
||||
if hasattr(image_list[i], 'serverId'):
|
||||
image_list[i].serverId = server_list[image_list[i].serverId] +
|
||||
' (' + str(image_list[i].serverId) + ')'
|
||||
utils.print_list(image_list, ['ID', 'Name', 'serverId','Status'])
|
||||
|
||||
|
||||
|
@ -286,8 +286,9 @@ def do_image_list(cs, args):
|
||||
server_list[server.id] = server.name
|
||||
image_list = cs.images.list()
|
||||
for i in range(len(image_list)):
|
||||
if hasattr(image_list[i],'serverId'):
|
||||
image_list[i].serverId = server_list[image_list[i].serverId] + ' (' + str(image_list[i].serverId) + ')'
|
||||
if hasattr(image_list[i], 'serverId'):
|
||||
image_list[i].serverId = server_list[image_list[i].serverId] +
|
||||
' (' + str(image_list[i].serverId) + ')'
|
||||
utils.print_list(cs.images.list(), ['ID', 'Name', 'serverId', 'Status'])
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user