[Verify] Fixing Tempest resources context to create network resources

Tempest resources context fails to create network resources because
Neutron raises the 'BadRequest: Invalid input for tenant_id. Reason:
'None' is not a valid string.' exception.
The issue was introduced by https://review.openstack.org/#/c/282918/.
So this patch is intended to fix the issue.

Closes-Bug: #1550848

Change-Id: I33b0bb2cdec55acf8446b0fab04e34c9f200fafd
This commit is contained in:
Yaroslav Lobankov 2016-02-27 21:40:27 -06:00
parent a088bfd53a
commit 6d5f0e645a
1 changed files with 4 additions and 2 deletions

View File

@ -479,10 +479,12 @@ class TempestResourcesContext(utils.RandomNameGeneratorMixin):
def _create_network_resources(self):
neutron_wrapper = network.NeutronWrapper(self.clients, self)
tenant_name = self.clients.keystone().tenant_name
tenant_id = self.clients.keystone().get_project_id(tenant_name)
LOG.debug("Creating network resources: network, subnet, router")
net = neutron_wrapper.create_network(
self.clients.keystone().tenant_id, subnets_num=1,
add_router=True, network_create_args={"shared": True})
tenant_id, subnets_num=1, add_router=True,
network_create_args={"shared": True})
self._created_networks.append(net)
return net