diff --git a/rally/plugins/openstack/scenarios/neutron/network.py b/rally/plugins/openstack/scenarios/neutron/network.py index 59bec825..bc8a37f6 100644 --- a/rally/plugins/openstack/scenarios/neutron/network.py +++ b/rally/plugins/openstack/scenarios/neutron/network.py @@ -116,7 +116,7 @@ class CreateAndListSubnets(utils.NeutronScenario): :param subnet_cidr_start: str, start value for subnets CIDR :param subnets_per_network: int, number of subnets for one network """ - network = self._get_or_create_network(network_create_args) + network = self._create_network(network_create_args or {}) self._create_subnets(network, subnet_create_args, subnet_cidr_start, subnets_per_network) self._list_subnets() @@ -145,7 +145,7 @@ class CreateAndUpdateSubnets(utils.NeutronScenario): :param subnet_cidr_start: str, start value for subnets CIDR :param subnets_per_network: int, number of subnets for one network """ - network = self._get_or_create_network(network_create_args) + network = self._create_network(network_create_args or {}) subnets = self._create_subnets(network, subnet_create_args, subnet_cidr_start, subnets_per_network) diff --git a/tests/unit/plugins/openstack/scenarios/neutron/test_network.py b/tests/unit/plugins/openstack/scenarios/neutron/test_network.py index 925a7d27..bc3b4cda 100644 --- a/tests/unit/plugins/openstack/scenarios/neutron/test_network.py +++ b/tests/unit/plugins/openstack/scenarios/neutron/test_network.py @@ -141,7 +141,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase): net = mock.MagicMock() scenario = network.CreateAndListSubnets(self.context) - scenario._get_or_create_network = mock.Mock(return_value=net) + scenario._create_network = mock.Mock(return_value=net) scenario._create_subnets = mock.Mock() scenario._list_subnets = mock.Mock() @@ -150,7 +150,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase): subnet_cidr_start=subnet_cidr_start, subnets_per_network=subnets_per_network) - scenario._get_or_create_network.assert_called_once_with( + scenario._create_network.assert_called_once_with( network_create_args) scenario._create_subnets.assert_called_once_with( net, subnet_create_args, subnet_cidr_start, subnets_per_network) @@ -167,7 +167,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase): subnets = [mock.MagicMock() for _ in range(subnets_per_network)] scenario = network.CreateAndUpdateSubnets(self.context) - scenario._get_or_create_network = mock.Mock(return_value=net) + scenario._create_network = mock.Mock(return_value=net) scenario._create_subnets = mock.Mock(return_value=subnets) scenario._update_subnet = mock.Mock() @@ -177,7 +177,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase): subnet_cidr_start=subnet_cidr_start, subnets_per_network=subnets_per_network) - scenario._get_or_create_network.assert_called_once_with( + scenario._create_network.assert_called_once_with( network_create_args) scenario._create_subnets.assert_called_once_with( net, subnet_create_args, subnet_cidr_start, subnets_per_network)