fixed flavor-list columns
This commit is contained in:
parent
c4119ddc22
commit
f862a6f618
|
@ -45,9 +45,9 @@ copyright = u'Rackspace, based on work by Jacob Kaplan-Moss'
|
|||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '2.4.1'
|
||||
version = '2.4'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '2.4.1'
|
||||
release = '2.4.2'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
|
|
@ -301,9 +301,19 @@ class OpenStackShell(object):
|
|||
metadata, files)
|
||||
print_dict(server._info)
|
||||
|
||||
def _translate_flavor_keys(self, collection):
|
||||
convert = [('ram', 'memory_mb'), ('disk', 'local_gb')]
|
||||
for item in collection:
|
||||
keys = item.__dict__.keys()
|
||||
for from_key, to_key in convert:
|
||||
if from_key in keys and to_key not in keys:
|
||||
setattr(item, to_key, item._info[from_key])
|
||||
|
||||
def do_flavor_list(self, args):
|
||||
"""Print a list of available 'flavors' (sizes of servers)."""
|
||||
print_list(self.cs.flavors.list(), [
|
||||
flavors = self.cs.flavors.list()
|
||||
self._translate_flavor_keys(flavors)
|
||||
print_list(flavors, [
|
||||
'ID',
|
||||
'Name',
|
||||
'Memory_MB',
|
||||
|
|
Loading…
Reference in New Issue