summaryrefslogtreecommitdiff
path: root/nova/network
diff options
context:
space:
mode:
authorAndrew Bonney <andrew.bonney@bbc.co.uk>2022-04-26 11:35:38 +0100
committerAndrew Bonney <andrew.bonney@bbc.co.uk>2022-04-27 10:24:57 +0100
commitee32934f34afd8e6df467361e9d71788cd36f6ee (patch)
tree1e4227259dd1dc5e1761e671ab37b161a9a30732 /nova/network
parent56b5aed08c6a3ed81b78dc216f0165ebfe3c3350 (diff)
downloadnova-ee32934f34afd8e6df467361e9d71788cd36f6ee.tar.gz
Fix segment-aware scheduling permissions error
Resolves a bug encountered when setting the Nova scheduler to be aware of Neutron routed provider network segments, by using 'query_placement_for_routed_network_aggregates'. Non-admin users attempting to access the 'segment_id' attribute of a subnet caused a traceback, resulting in instance creation failure. This patch ensures the Neutron client is initialised with an administrative context no matter what the requesting user's permissions are. Change-Id: Ic0f25e4d2395560fc2b68f3b469e266ac59abaa2 Closes-Bug: #1970383
Diffstat (limited to 'nova/network')
-rw-r--r--nova/network/neutron.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/network/neutron.py b/nova/network/neutron.py
index 26ca07dc6e..d091405ca0 100644
--- a/nova/network/neutron.py
+++ b/nova/network/neutron.py
@@ -3855,7 +3855,7 @@ class API:
either Segment extension isn't enabled in Neutron or if the network
isn't configured for routing.
"""
- client = get_client(context)
+ client = get_client(context, admin=True)
if not self.has_segment_extension(client=client):
return []
@@ -3886,7 +3886,7 @@ class API:
extension isn't enabled in Neutron or the provided subnet doesn't
have segments (if the related network isn't configured for routing)
"""
- client = get_client(context)
+ client = get_client(context, admin=True)
if not self.has_segment_extension(client=client):
return None