← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1358818] [NEW] extra_specs string check breaks backward compatibility

 

Public bug reported:

We've found that while with Icehouse we were able to specify extra_specs
values as ints or floats, in Juno the command fails unless we make these
values strings by quoting them. This breaks backward compatibility.

compare Icehouse:

curl -k -i -X POST http://127.0.0.1:8774/v2/982607a6a1134514abac252fc25384ad/flavors/1/os-extra_specs -H "X-Auth-Token: *****" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"extra_specs":{"powervm:proc_units":"0.2","powervm:processor_compatibility":"default","powervm:min_proc_units":"0.1","powervm:max_proc_units":"0.5","powervm:min_vcpu":1,"powervm:max_vcpu":5,"powervm:min_mem":1024,"powervm:max_mem":4096,"powervm:availability_priority":127,"powervm:dedicated_proc":"false","powervm:uncapped":"true","powervm:shared_weight":128}}'; echo
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 385
X-Compute-Request-Id: req-9132922d-c703-4573-9822-9ca7a6bf7b0d
Date: Thu, 14 Aug 2014 18:25:02 GMT

{"extra_specs": {"powervm:processor_compatibility": "default",
"powervm:max_proc_units": "0.5", "powervm:shared_weight": 128,
"powervm:min_mem": 1024, "powervm:max_mem": 4096, "powervm:uncapped":
"true", "powervm:proc_units": "0.2", "powervm:dedicated_proc": "false",
"powervm:max_vcpu": 5, "powervm:availability_priority": 127,
"powervm:min_proc_units": "0.1", "powervm:min_vcpu": 1}}


to Juno:

curl -k -i -X POST http://127.0.0.1:8774/v2/be2ffade1e0b4bed83619e00482317d1/flavors/1/os-extra_specs -H "X-Auth-Token: *****" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"extra_specs":{"powervm:proc_units":"0.2","powervm:processor_compatibility":"default","powervm:min_proc_units":"0.1","powervm:max_proc_units":"0.5","powervm:min_vcpu":1,"powervm:max_vcpu":5,"powervm:min_mem":1024,"powervm:max_mem":4096,"powervm:availability_priority":127,"powervm:dedicated_proc":"false","powervm:uncapped":"true","powervm:shared_weight":128}}'; echo
HTTP/1.1 400 Bad Request
Content-Length: 88
Content-Type: application/json; charset=UTF-8
Date: Thu, 14 Aug 2014 18:25:46 GMT

{"badRequest": {"message": "extra_specs value is not a string or
unicode", "code": 400}}


if I modify the data sent so that everything is a string, it will work for Juno:

curl -k -i -X POST http://127.0.0.1:8774/v2/be2ffade1e0b4bed83619e00482317d1/flavors/1/os-extra_specs -H "X-Auth-Token: *****" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"extra_specs":{"powervm:proc_units":"0.2","powervm:processor_compatibility":"default","powervm:min_proc_units":"0.1","powervm:max_proc_units":"0.5","powervm:min_vcpu":"1","powervm:max_vcpu":"5","powervm:min_mem":"1024","powervm:max_mem":"4096","powervm:availability_priority":"127","powervm:dedicated_proc":"false","powervm:uncapped":"true","powervm:shared_weight":"128"}}'; echo
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 397
Date: Thu, 14 Aug 2014 18:26:27 GMT

{"extra_specs": {"powervm:processor_compatibility": "default",
"powervm:max_proc_units": "0.5", "powervm:shared_weight": "128",
"powervm:min_mem": "1024", "powervm:max_mem": "4096",
"powervm:uncapped": "true", "powervm:proc_units": "0.2",
"powervm:dedicated_proc": "false", "powervm:max_vcpu": "5",
"powervm:availability_priority": "127", "powervm:min_proc_units": "0.1",
"powervm:min_vcpu": "1"}}


The API change guidelines (https://wiki.openstack.org/wiki/APIChangeGuidelines) describe as "generally not acceptable": "A change such that a request which was successful before now results in an error response (unless the success reported previously was hiding an existing error condition)". That is exactly what this is.

** Affects: nova
     Importance: Undecided
         Status: New

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

Title:
  extra_specs string check breaks backward compatibility

Status in OpenStack Compute (Nova):
  New

Bug description:
  We've found that while with Icehouse we were able to specify
  extra_specs values as ints or floats, in Juno the command fails unless
  we make these values strings by quoting them. This breaks backward
  compatibility.

  compare Icehouse:

  curl -k -i -X POST http://127.0.0.1:8774/v2/982607a6a1134514abac252fc25384ad/flavors/1/os-extra_specs -H "X-Auth-Token: *****" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"extra_specs":{"powervm:proc_units":"0.2","powervm:processor_compatibility":"default","powervm:min_proc_units":"0.1","powervm:max_proc_units":"0.5","powervm:min_vcpu":1,"powervm:max_vcpu":5,"powervm:min_mem":1024,"powervm:max_mem":4096,"powervm:availability_priority":127,"powervm:dedicated_proc":"false","powervm:uncapped":"true","powervm:shared_weight":128}}'; echo
  HTTP/1.1 200 OK
  Content-Type: application/json
  Content-Length: 385
  X-Compute-Request-Id: req-9132922d-c703-4573-9822-9ca7a6bf7b0d
  Date: Thu, 14 Aug 2014 18:25:02 GMT

  {"extra_specs": {"powervm:processor_compatibility": "default",
  "powervm:max_proc_units": "0.5", "powervm:shared_weight": 128,
  "powervm:min_mem": 1024, "powervm:max_mem": 4096, "powervm:uncapped":
  "true", "powervm:proc_units": "0.2", "powervm:dedicated_proc":
  "false", "powervm:max_vcpu": 5, "powervm:availability_priority": 127,
  "powervm:min_proc_units": "0.1", "powervm:min_vcpu": 1}}

  
  to Juno:

  curl -k -i -X POST http://127.0.0.1:8774/v2/be2ffade1e0b4bed83619e00482317d1/flavors/1/os-extra_specs -H "X-Auth-Token: *****" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"extra_specs":{"powervm:proc_units":"0.2","powervm:processor_compatibility":"default","powervm:min_proc_units":"0.1","powervm:max_proc_units":"0.5","powervm:min_vcpu":1,"powervm:max_vcpu":5,"powervm:min_mem":1024,"powervm:max_mem":4096,"powervm:availability_priority":127,"powervm:dedicated_proc":"false","powervm:uncapped":"true","powervm:shared_weight":128}}'; echo
  HTTP/1.1 400 Bad Request
  Content-Length: 88
  Content-Type: application/json; charset=UTF-8
  Date: Thu, 14 Aug 2014 18:25:46 GMT

  {"badRequest": {"message": "extra_specs value is not a string or
  unicode", "code": 400}}

  
  if I modify the data sent so that everything is a string, it will work for Juno:

  curl -k -i -X POST http://127.0.0.1:8774/v2/be2ffade1e0b4bed83619e00482317d1/flavors/1/os-extra_specs -H "X-Auth-Token: *****" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"extra_specs":{"powervm:proc_units":"0.2","powervm:processor_compatibility":"default","powervm:min_proc_units":"0.1","powervm:max_proc_units":"0.5","powervm:min_vcpu":"1","powervm:max_vcpu":"5","powervm:min_mem":"1024","powervm:max_mem":"4096","powervm:availability_priority":"127","powervm:dedicated_proc":"false","powervm:uncapped":"true","powervm:shared_weight":"128"}}'; echo
  HTTP/1.1 200 OK
  Content-Type: application/json
  Content-Length: 397
  Date: Thu, 14 Aug 2014 18:26:27 GMT

  {"extra_specs": {"powervm:processor_compatibility": "default",
  "powervm:max_proc_units": "0.5", "powervm:shared_weight": "128",
  "powervm:min_mem": "1024", "powervm:max_mem": "4096",
  "powervm:uncapped": "true", "powervm:proc_units": "0.2",
  "powervm:dedicated_proc": "false", "powervm:max_vcpu": "5",
  "powervm:availability_priority": "127", "powervm:min_proc_units":
  "0.1", "powervm:min_vcpu": "1"}}

  
  The API change guidelines (https://wiki.openstack.org/wiki/APIChangeGuidelines) describe as "generally not acceptable": "A change such that a request which was successful before now results in an error response (unless the success reported previously was hiding an existing error condition)". That is exactly what this is.

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


Follow ups

References