fixed flavor-list columns

This commit is contained in:
Sandy Walsh 2011-04-08 15:36:39 -03:00
parent c4119ddc22
commit f862a6f618
3 changed files with 14 additions and 4 deletions

View File

@ -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.

View File

@ -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',

View File

@ -11,7 +11,7 @@ if sys.version_info < (2,6):
setup(
name = "python-novaclient",
version = "2.4.1",
version = "2.4.2",
description = "Client library for OpenStack Nova API",
long_description = read('README.rst'),
url = 'https://github.com/rackspace/python-novaclient',