PreProvisionedCredentialProvider does not handle os-networks extension not being enabled

Bug #1600349 reported by Daryl Walleck on 2016-07-08
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tempest
Undecided
Daryl Walleck

Bug Description

When using an accounts file with networks associated with a user, the PreProvisionedCredentialProvider attempts to determine the id of the provided networks using the os-networks extension. However, the provider does not handle the case where the user may not have access to the os-networks extension.

======================================================================
FAIL: setUpClass (tempest.api.compute.servers.test_list_server_filters.ListServerFiltersTestJSON)
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/test.py", line 273, in setUpClass
    six.reraise(etype, value, trace)
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/test.py", line 261, in setUpClass
    cls.setup_credentials()
File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/api/compute/servers/test_list_server_filters.py", line 33, in setup_credentials
    super(ListServerFiltersTestJSON, cls).setup_credentials()
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/api/compute/base.py", line 61, in setup_credentials
    super(BaseV2ComputeTest, cls).setup_credentials()
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/test.py", line 361, in setup_credentials
    credential_type=credentials_type)
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/test.py", line 535, in get_client_manager
    creds = getattr(cred_provider, credentials_method)()
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/common/preprov_creds.py", line 286, in get_primary_creds
    net_creds = self._get_creds()
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/common/preprov_creds.py", line 249, in _get_creds
    return self._wrap_creds_with_network(free_hash)
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/common/preprov_creds.py", line 345, in _wrap_creds_with_network
    net_name, compute_network_client)
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/common/fixed_network.py", line 39, in get_network_from_name
    networks = compute_networks_client.list_networks()['networks']
File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/lib/services/compute/networks_client.py", line 25, in list_networks
    resp, body = self.get("os-networks")
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/lib/common/rest_client.py", line 285, in get
    return self.request('GET', url, extra_headers, headers)
File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/lib/services/compute/base_compute_client.py", line 48, in request
    method, url, extra_headers, headers, body, chunked)
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/lib/common/rest_client.py", line 664, in request
    resp, resp_body)
  File "/mnt/c/Users/dwall/Documents/GitHub/openstack/tempest/tempest/lib/common/rest_client.py", line 762, in _error_checker
    raise exceptions.NotFound(resp_body, resp=resp)
tempest.lib.exceptions.NotFound: Object not found
Details: 404 Not Found

The provider should handle this case in some way, possibly by ignoring the resource or by providing a more explicit error (Could not configure network resources because the os-networks extension was not found).

Fix proposed to branch: master
Review: https://review.openstack.org/341592

Changed in tempest:
assignee: nobody → Daryl Walleck (dwalleck)
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers