Validate rxtx_factor as a float.
Updates the rxtx_factor validations in the instance_types modules so that rxtx_factor is validated as a float. Given that rxtx_factor is stored as a float in the database this makes sense... and also adheres to some of the extension documentation as well (although some of the extension docs were incorrect as well). Previously rxtx_factor was being cast into an int which caused it to be stored and displayed incorrectly via the API. This patchset adds a test which fails with the old code. Additionally some of the API docs are corrected so that rxtx_factor is listed as a float in all examples. Fixes LP Bug #1081287. Change-Id: Iae98522a1f2ed63cbd2497b0b0af5ac2d9bb935c
This commit is contained in:
8 changed files with 38 additions and 17 deletions
@@ -808,7 +808,7 @@ class InstanceTypeCommands(object):
@args('--is_public', dest="is_public", metavar='<is_public>',
help='Make flavor accessible to the public')
def create(self, name, memory, vcpus, root_gb, ephemeral_gb=0,
flavorid=None, swap=0, rxtx_factor=1, is_public=True):
flavorid=None, swap=0, rxtx_factor=1.0, is_public=True):
"""Creates instance types / flavors"""
try:
instance_types.create(name, memory, vcpus, root_gb,
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.