PreProvisionedCredentialProvider does not handle os-networks extension not being enabled

Bug #1600349 reported by Daryl Walleck
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tempest
Expired
Undecided
Unassigned

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).

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

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

Changed in tempest:
assignee: nobody → Daryl Walleck (dwalleck)
status: New → In Progress
Revision history for this message
Doug Schveninger (ds6901) wrote :

The way the server API handle authorization is up to the service. Some services return 404 instead of the 403. This i a design of the service not of tempest.

Revision history for this message
Martin Kopec (mkopec) wrote :

os-networks seems to be deprecated -> https://docs.openstack.org/nova/latest/configuration/policy.html
Also I tried to run tempest.api.compute.servers.test_list_server_filters.ListServerFiltersTestJSON tests with an accounts file and they passed even though my tempest.conf doesn't contain os-networks network extension.

As the bug report is more than 4 years old and the tempest's source code has changed a lot since then, I'll mark this as Incomplete. However, if you're still able reproduce the issue, feel free to reopen this.

Changed in tempest:
assignee: Daryl Walleck (dwalleck) → nobody
status: In Progress → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for tempest because there has been no activity for 60 days.]

Changed in tempest:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.