On 03/23/2012 11:51 AM, David Kranz wrote:
I am getting the following failure on a new essex cluster using Ubuntu
packages. It seems 404 (NotFound) is expected by Tempest. Has any one
seen this? This test was passing fairly recently...

-David

======================================================================
ERROR: Negative test: The server rebuild for a non existing server
should not
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/cygdrive/c/source/tempest/tempest/tests/test_server_actions.py", line
158, in test_rebuild_nonexistant_server
adminPass='rebuild')
File
"/cygdrive/c/source/tempest/tempest/services/nova/json/servers_client.py",
line 217, in rebuild
self.headers)
File "/cygdrive/c/source/tempest/tempest/common/rest_client.py", line
100, in post
return self.request('POST', url, headers, body)
File "/cygdrive/c/source/tempest/tempest/common/rest_client.py", line
136, in request
raise exceptions.BadRequest(resp_body['badRequest']['message'])
BadRequest: Bad request
Details: Bad request
Details: Invalid imageRef provided.
-------------------->> begin captured logging<< --------------------
tempest.common.rest_client: ERROR: Request URL:
http://172.18.0.146:8774/v2/30db781b8c044409810ab5bdcd175968/servers/999/action

tempest.common.rest_client: ERROR: Request Body: {"rebuild":
{"personality": [{"path": "/etc/rebuild.txt", "contents":
"VGVzdCBzZXJ2ZXIgcmVidWlsZC4="}], "metadata": {"rebuild": "server"},
"name": "server93407542699", "imageRef":
"346f4039-a81e-44e0-9223-4a3d13c907", "adminPass": "rebuild"}}
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Fri, 23
Mar 2012 15:42:43 GMT', 'status': '400', 'content-length': '70',
'content-type': 'application/json; charset=UTF-8',
'x-compute-request-id': 'req-67ec2a25-0ed9-4451-ba01-ee247df51f09'}
tempest.common.rest_client: ERROR: Response Body: {u'badRequest':
{u'message': u'Invalid imageRef provided.', u'code': 400}}
--------------------->> end captured logging<<

Looking into the Nova codebase, the only place that Invalid imageRef was used is this block of code:

    def _image_uuid_from_href(self, image_href):
        # If the image href was generated by nova api, strip image_href
        # down to an id and use the default glance connection params
        image_uuid = image_href.split('/').pop()

        if not utils.is_uuid_like(image_uuid):
            msg = _("Invalid imageRef provided.")
            raise exc.HTTPBadRequest(explanation=msg)

        return image_uuid

So, it seems that the utils.is_uuid_like() does not think that "346f4039-a81e-44e0-9223-4a3d13c907" looks like a UUID :)

The method looks like this:

def is_uuid_like(val):
    """For our purposes, a UUID is a string in canonical form:

        aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
    """
    try:
        uuid.UUID(val)
        return True
    except (TypeError, ValueError, AttributeError):
        return False

After trying this in a Python interpreter:

jpipes@uberbox:~/repos/nova$ python
Python 2.7.2+ (default, Oct  4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import uuid
>>> def is_uuid_like(val):
...     """For our purposes, a UUID is a string in canonical form:
...
...         aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
...     """
...     try:
...         uuid.UUID(val)
...         return True
...     except (TypeError, ValueError, AttributeError):
...         return False
...
>>> print is_uuid_like("346f4039-a81e-44e0-9223-4a3d13c907")
False

Could it be that you incorrectly copy-pasted the image UUID into your tempest.conf?

Best,
-jay

--
Mailing list: https://launchpad.net/~openstack-qa-team
Post to     : openstack-qa-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack-qa-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to