← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1264452] Re: update method in os-services v2api raise unexpect exception

 

** Changed in: nova
       Status: In Progress => Invalid

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

Title:
  update method in os-services v2api raise unexpect exception

Status in OpenStack Compute (Nova):
  Invalid

Bug description:
  when review the os-services v2api code, I found update method have some bug.
  nova/api/openstack/compute/contrib/services.py:
  the original code:
   def update(self, req, id, body):
      ........
      except (TypeError, KeyError):
              msg = _('Invalid attribute in the request')
              if 'host' in body and 'binary' in body:
                  msg = _('Missing disabled reason field')
              raise webob.exc.HTTPBadRequest(detail=msg)

  parameter body is a dict:
  body={"service":{
                                  "host":"xxx",
                                 "binary":"xxxx",
                                  ....
                                  }}
  so the 'msg' will nerver be '_('Missing disabled reason field')'.
  the code should be "if "host" in body['service']" not "if "host" in body"

  v3 api has the same issue. but the input checking for the V3 API is
  all getting replaced by jsonschema,so we only modify v2 api.

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


References