← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1243195] Re: Upper bounds checking not performed on flavor-create API

 

** Changed in: nova
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1243195

Title:
  Upper bounds checking not performed on flavor-create API

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  The flavor-create API does validation that root_gb and other integer
  values are positive integers but it doesn't do an upper bounds check
  to make sure they aren't longs.  If a user tries to create a flavor
  with an integer value that is bigger than an int, the python int()
  method (used in the validation) will just convert it to a long but the
  database model for InstanceTypes defines the column as an Integer (not
  a BigInteger) and then the database has to handle the value.

  Some examples:

  http://paste.openstack.org/show/48988/

  The nova.compute.flavor.create() method should validate that the
  integer values are actually integers and not longs (I'd suggest
  checking to make sure the int values are <= sys.maxint).

  From the DB model, it looks like these are the fields that need the
  validation:

      memory_mb = Column(Integer, nullable=False)
      vcpus = Column(Integer, nullable=False)
      root_gb = Column(Integer)
      ephemeral_gb = Column(Integer)
      swap = Column(Integer, nullable=False, default=0)
      vcpu_weight = Column(Integer)

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1243195/+subscriptions