yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #40831
[Bug 1513645] [NEW] Inconsistent use of admin/non-admin context in neutron network api while preparing network info
Public bug reported:
In allocate_for_instance, Neutron network API calls Neutron to create
the port(s)[1]. Once the port is created, it formats network info in
network info model, before returning it to Compute Manager [2]. To form
network info, the API makes several calls to Neutron.
1. List ports for device id [3]
2. Get associated floating IPs [4]
3. Get subnets from port [5] & [6]
Notice that, in 3 & 4, the API uses admin context to talk to Neutron,
whereas in 6, it doesn't use admin context.
This is inconsistent. Is this intentional?
[1] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L716
[2] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L739-L741
[3] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1671-L1676
[4] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1555-L1566
[5] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1568-L1573
[6] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1755-L1756
** Affects: nova
Importance: Undecided
Assignee: Shraddha Pandhe (shraddha-pandhe)
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1513645
Title:
Inconsistent use of admin/non-admin context in neutron network api
while preparing network info
Status in OpenStack Compute (nova):
New
Bug description:
In allocate_for_instance, Neutron network API calls Neutron to create
the port(s)[1]. Once the port is created, it formats network info in
network info model, before returning it to Compute Manager [2]. To
form network info, the API makes several calls to Neutron.
1. List ports for device id [3]
2. Get associated floating IPs [4]
3. Get subnets from port [5] & [6]
Notice that, in 3 & 4, the API uses admin context to talk to Neutron,
whereas in 6, it doesn't use admin context.
This is inconsistent. Is this intentional?
[1] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L716
[2] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L739-L741
[3] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1671-L1676
[4] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1555-L1566
[5] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1568-L1573
[6] https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1755-L1756
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1513645/+subscriptions
Follow ups