Skip to content

Commit

Permalink
Cleans up the flavor creation code. Fixes bug 1080891.
Browse files Browse the repository at this point in the history
Change-Id: Idc76cd01d1537ab87723a05ab8dd81015284e3c8
  • Loading branch information
gabrielhurley committed Nov 18, 2012
1 parent aa8d44c commit e9b015c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions novaclient/v1_1/flavors.py
Expand Up @@ -104,7 +104,7 @@ def delete(self, flavor):
"""
self._delete("/flavors/%s" % base.getid(flavor))

def create(self, name, ram, vcpus, disk, flavorid,
def create(self, name, ram, vcpus, disk, flavorid=None,
ephemeral=0, swap=0, rxtx_factor=1, is_public=True):
"""
Create (allocate) a floating ip for a tenant
Expand All @@ -113,7 +113,9 @@ def create(self, name, ram, vcpus, disk, flavorid,
:param ram: Memory in MB for the flavor
:param vcpu: Number of VCPUs for the flavor
:param disk: Size of local disk in GB
:param flavorid: Integer ID for the flavor
:param flavorid: ID for the flavor (optional). You can use the reserved
value ``"auto"`` to have Nova generate a UUID for the
flavor in cases where you cannot simply pass ``None``.
:param swap: Swap space in MB
:param rxtx_factor: RX/TX factor
:rtype: :class:`Flavor`
Expand Down Expand Up @@ -143,9 +145,9 @@ def create(self, name, ram, vcpus, disk, flavorid,
raise exceptions.CommandError("Swap must be an integer.")

try:
ephemerel = int(ephemeral)
ephemeral = int(ephemeral)
except:
raise exceptions.CommandError("Ephemerel must be an integer.")
raise exceptions.CommandError("Ephemeral must be an integer.")

try:
rxtx_factor = int(rxtx_factor)
Expand Down

0 comments on commit e9b015c

Please sign in to comment.