Merge "create_subnet: Add filter on tenant_id if specified"

This commit is contained in:
Zuul 2018-03-31 13:39:32 +00:00 committed by Gerrit Code Review
commit db1696a529
1 changed files with 6 additions and 1 deletions

View File

@ -7828,7 +7828,12 @@ class OpenStackCloud(
:raises: OpenStackCloudException on operation error.
"""
network = self.get_network(network_name_or_id)
if tenant_id is not None:
filters = {'tenant_id': tenant_id}
else:
filters = None
network = self.get_network(network_name_or_id, filters)
if not network:
raise OpenStackCloudException(
"Network %s not found." % network_name_or_id)