File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1873,6 +1873,8 @@ def port_list_with_trunk_types(request, **params):
1873
1873
trunk_filters = {}
1874
1874
if 'tenant_id' in params :
1875
1875
trunk_filters ['tenant_id' ] = params ['tenant_id' ]
1876
+ elif 'project_id' in params :
1877
+ trunk_filters ['project_id' ] = params ['project_id' ]
1876
1878
trunks = networkclient (request ).trunks (** trunk_filters )
1877
1879
parent_ports = set (t ['port_id' ] for t in trunks )
1878
1880
# Create a dict map for child ports (port ID to trunk info)
Original file line number Diff line number Diff line change @@ -138,10 +138,9 @@ def get(self, request):
138
138
a port.
139
139
"""
140
140
# https://opendev.org/openstack/neutron/src/branch/master/neutron/tests/unit/extensions/v2attributes.py
141
- project_id = request .user .project_id
142
- result = api .neutron .port_list_with_trunk_types (request ,
143
- project_id = project_id ,
144
- ** request .GET .dict ())
141
+ params = request .GET .dict ()
142
+ params .setdefault ("project_id" , request .user .project_id )
143
+ result = api .neutron .port_list_with_trunk_types (request , ** params )
145
144
return {'items' : [n .to_dict () for n in result ]}
146
145
147
146
You can’t perform that action at this time.
0 commit comments