nova/nova/api
Balazs Gibizer 4cb493fe4f Use admin neutron client to see if instance has qos ports
The nova-api checks at each move* operation if the instance has qos port
attached as not all the move operations are supported for such servers.
Nova uses the request context to initialize the neutron client for the
port query. However neutron does not return the value of the
resource_request of the port if it is queried with a non admin client.
This causes that if the move operation is initiated by a non admin
then nova thinks that the ports do not have resource request.

This patch creates an admin context for this neutron query.

The new functional tests are not added before this patch in a regression
test like way as existing functional tests are reused with different
setup and doing that without the fix causes a lot of different failure
scenarios.

Note that neutron fixture is changed to simulate the different behavior
in case of different request context are used to initialize the client.

*: Note that Id5f2f4f22b856c989e2eef8ed56b9829d1bcefb6 removed the check
   for evacuate in Ussuri but exists in Train and Stein.

Conflicts:
      nova/tests/fixtures.py
Due to d2d4317e1a is missing from
stable/train

Another difference from the original patch is in
nova/api/openstack/compute/evacuate.py due to
Id5f2f4f22b856c989e2eef8ed56b9829d1bcefb6 is only merged in Ussuri.

Change-Id: I3cf6eb4654663865d9258c38f05cd05974ffcf9d
Closes-Bug: #1850280
(cherry picked from commit 8999769605)
2019-11-13 13:40:59 +01:00
..
ec2 ec2: Remove unused functions from 'ec2utils' 2019-07-10 16:15:19 +01:00
metadata hacking: Resolve W503 (line break occurred before a binary operator) 2019-06-24 14:24:06 -05:00
openstack Use admin neutron client to see if instance has qos ports 2019-11-13 13:40:59 +01:00
validation Multiple API cleanup changes 2019-08-12 08:52:38 -05:00
__init__.py Remove unused copyright from nova.api.__init__ 2014-01-10 16:24:50 +08:00
auth.py Refactor WSGI apps and utils to limit imports 2018-03-06 22:05:12 +00:00
compute_req_id.py Migrate to oslo request_id middleware - mv 2.46 2017-05-27 10:11:44 +00:00
manager.py Only setup iptables for metadata if using nova-net 2017-07-20 00:00:22 +00:00
wsgi.py Refactor WSGI apps and utils to limit imports 2018-03-06 22:05:12 +00:00