← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1815476] [NEW] Flavor attribute 'swap' returns unicode'' instead of int 0

 

Public bug reported:

Description
===========
When a flavor is created in Horizon with 'Swap Disk (MB)' -> 0.
Nova python API returns unicode'' on flavor.swap attribute.

When swap disk is changed to 10.
API returns -> int 10 instead of unicode.

Steps to reproduce
==================
- In horizon create a new flavor with swap disk 0
- connect to the nova python API.

fl = nova.flavors.find(name="your flavor")
print fl.swap
print(type(fl.swap))

output:

<type 'unicode'>


Expected result
===============
int 0

Actual result
=============
unicode ''


Environment
===========


ubuntu@juju-5dc387-0-lxd-6:~$ nova-manage --version
15.1.5

ubuntu@juju-5dc387-0-lxd-6:~$ dpkg -l | grep nova
ii  nova-api-os-compute              2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - OpenStack Compute API frontend
ii  nova-common                      2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - common files
ii  nova-conductor                   2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - conductor service
ii  nova-consoleauth                 2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - Console Authenticator
ii  nova-novncproxy                  2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - NoVNC proxy
ii  nova-placement-api               2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - placement API frontend
ii  nova-scheduler                   2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - virtual machine scheduler
ii  python-nova                      2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute Python libraries


xx@xx-dev:~/Documents$ openstack --version
openstack 3.14.2

** Affects: nova
     Importance: Undecided
         Status: New

** Summary changed:

- Flavor attribute returns unicode'' when 0
+ Flavor attribute 'swap' returns unicode'' when 0 instead of int

** Summary changed:

- Flavor attribute 'swap' returns unicode'' when 0 instead of int
+ Flavor attribute 'swap' returns unicode'' instead of int 0

-- 
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/1815476

Title:
  Flavor attribute 'swap' returns unicode'' instead of int 0

Status in OpenStack Compute (nova):
  New

Bug description:
  Description
  ===========
  When a flavor is created in Horizon with 'Swap Disk (MB)' -> 0.
  Nova python API returns unicode'' on flavor.swap attribute.

  When swap disk is changed to 10.
  API returns -> int 10 instead of unicode.

  Steps to reproduce
  ==================
  - In horizon create a new flavor with swap disk 0
  - connect to the nova python API.

  fl = nova.flavors.find(name="your flavor")
  print fl.swap
  print(type(fl.swap))

  output:

  <type 'unicode'>

  
  Expected result
  ===============
  int 0

  Actual result
  =============
  unicode ''

  
  Environment
  ===========

  
  ubuntu@juju-5dc387-0-lxd-6:~$ nova-manage --version
  15.1.5

  ubuntu@juju-5dc387-0-lxd-6:~$ dpkg -l | grep nova
  ii  nova-api-os-compute              2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - OpenStack Compute API frontend
  ii  nova-common                      2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - common files
  ii  nova-conductor                   2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - conductor service
  ii  nova-consoleauth                 2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - Console Authenticator
  ii  nova-novncproxy                  2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - NoVNC proxy
  ii  nova-placement-api               2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - placement API frontend
  ii  nova-scheduler                   2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute - virtual machine scheduler
  ii  python-nova                      2:15.1.5-0ubuntu1~cloud0                   all          OpenStack Compute Python libraries

  
  xx@xx-dev:~/Documents$ openstack --version
  openstack 3.14.2

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


Follow ups