← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1156684] Re: Modify _verify_response to check for response codes

 

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

** Changed in: nova
    Milestone: None => havana-1

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

Title:
  Modify _verify_response to check for response codes

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  While looking at the tests in
  nova/tests/integrated/test_api_samples.py, I noticed that many of them
  are missing the tests to validate the response code after invoking the
  REST API.

  My suggestion to this problem is to change _verify_response to:
  a) include a check for the return code.
  b) take an extra parm (having default value=200) for the return code which for now is only needed for those cases where we still have inconsistency in the those APIs returning 202 instead of 200.
  Once we fix those APIs, that parm should be taken out and the method should always check for 200 as the return code.

  By doing this we add the following benefits:
  1) Developers writing sample tests don't have to make the call to Assert for the right response code anymore (often forgotten).
  2) _verify_response is called in each test to verify the response. By having the test in the fcn, we guarantee the check is always done.

  Later, we could add a trap to make sure no new API is passing the
  return code to the fcn. Instead, always assume the error code is 200
  as it should be.

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