Merge "Remove _get_trunks method for openstacksdk client."
This commit is contained in:
commit
381af76bf8
|
@ -91,17 +91,6 @@ def _create_ports(self, payload):
|
|||
return (os_port.Port(**item) for item in response.json()['ports'])
|
||||
|
||||
|
||||
def _get_trunks(self, payload):
|
||||
"""Return trunks filtered by whatever"""
|
||||
# TODO(gryf): Trunk object have been updated in OpenStackSDK 0.21. After
|
||||
# we bump to this version (or higher), this method can be safely removed,
|
||||
# and its call replaced with:
|
||||
# os_net.trunks(tags=[...])
|
||||
response = self.get(os_trunk.Trunk.base_path, params=payload)
|
||||
os_exc.raise_from_response(response)
|
||||
return (os_trunk.Trunk(**item) for item in response.json()['trunks'])
|
||||
|
||||
|
||||
def _add_trunk_subports(self, trunk, subports):
|
||||
"""Set sub_ports on trunk
|
||||
|
||||
|
@ -152,7 +141,6 @@ def setup_openstacksdk():
|
|||
session=session,
|
||||
region_name=getattr(config.CONF.neutron, 'region_name', None))
|
||||
conn.network.create_ports = partial(_create_ports, conn.network)
|
||||
conn.network.get_trunks = partial(_get_trunks, conn.network)
|
||||
conn.network.add_trunk_subports = partial(_add_trunk_subports,
|
||||
conn.network)
|
||||
conn.network.delete_trunk_subports = partial(_delete_trunk_subports,
|
||||
|
|
|
@ -676,12 +676,12 @@ class NestedVIFPool(BaseVIFPool):
|
|||
|
||||
def _get_parent_port_id(self, vif):
|
||||
os_net = clients.get_network_client()
|
||||
args = {}
|
||||
tags = []
|
||||
|
||||
if config.CONF.neutron_defaults.resource_tags:
|
||||
args['tags'] = config.CONF.neutron_defaults.resource_tags
|
||||
tags = config.CONF.neutron_defaults.resource_tags
|
||||
|
||||
trunks = os_net.get_trunks(args)
|
||||
trunks = os_net.trunks(tags=tags)
|
||||
|
||||
for trunk in trunks:
|
||||
for sp in trunk.sub_ports:
|
||||
|
|
Loading…
Reference in New Issue