summaryrefslogtreecommitdiffstats
path: root/nova/cmd
diff options
context:
space:
mode:
authorRick Harris <rconradharris@gmail.com>2013-05-14 01:01:33 +0000
committerRick Harris <rconradharris@gmail.com>2013-05-14 05:10:24 +0000
commit6f89e26d01b33942398165cdd7ccd168533170c4 (patch)
treeea11ac4ed35bf3e6116def5a523e86c84598ab6a /nova/cmd
parent87afef9121a6299f92a3b24059009c1c7a966d39 (diff)
downloadnova-6f89e26d01b33942398165cdd7ccd168533170c4.tar.gz
nova-6f89e26d01b33942398165cdd7ccd168533170c4.tar.xz
nova-6f89e26d01b33942398165cdd7ccd168533170c4.zip
Cleanups for create-flavor
Instead of setting defaults values to None in the signature and then setting the *real* default in the function body, it's more concise/readable to set the value in the signature itself (when dealing with immutable types). Along with this, the handling of `memory_mb` and `vcpus` was detangled so the attributes were handled in one place and not across both the non-negative and positive int checks. Change-Id: I1c06768c2fd076adc8c0a647a492dabb67b7bf79
Diffstat (limited to 'nova/cmd')
-rw-r--r--nova/cmd/manage.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/cmd/manage.py b/nova/cmd/manage.py
index 9bec62f09..2649b1ddf 100644
--- a/nova/cmd/manage.py
+++ b/nova/cmd/manage.py
@@ -890,8 +890,9 @@ class InstanceTypeCommands(object):
"""Creates instance types / flavors."""
try:
flavors.create(name, memory, vcpus, root_gb,
- ephemeral_gb, flavorid, swap, rxtx_factor,
- is_public)
+ ephemeral_gb=ephemeral_gb, flavorid=flavorid,
+ swap=swap, rxtx_factor=rxtx_factor,
+ is_public=is_public)
except exception.InvalidInput as e:
print _("Must supply valid parameters to create instance_type")
print e