diff --git a/sahara_dashboard/content/data_processing/clusters/clusters/tabs.py b/sahara_dashboard/content/data_processing/clusters/clusters/tabs.py index 476a4292..2df89f2b 100644 --- a/sahara_dashboard/content/data_processing/clusters/clusters/tabs.py +++ b/sahara_dashboard/content/data_processing/clusters/clusters/tabs.py @@ -20,7 +20,6 @@ from horizon import exceptions from horizon import tables from horizon import tabs from openstack_dashboard.api import glance -from openstack_dashboard.api import network from openstack_dashboard.api import neutron from openstack_dashboard.api import nova @@ -164,7 +163,7 @@ class NodeGroupsTab(tabs.Tab): return {"cluster": cluster} def _get_floating_ip_pool_name(self, request, pool_id): - pools = [pool for pool in network.floating_ip_pools_list( + pools = [pool for pool in neutron.floating_ip_pools_list( request) if pool.id == pool_id] return pools[0].name if pools else pool_id diff --git a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tabs.py b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tabs.py index 8610533f..b82283af 100644 --- a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tabs.py +++ b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tabs.py @@ -17,7 +17,7 @@ from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import tabs -from openstack_dashboard.api import network +from openstack_dashboard.api import neutron from openstack_dashboard.api import nova from sahara_dashboard.api import sahara as saharaclient @@ -104,7 +104,7 @@ class GeneralTab(tabs.Tab): "security_groups": security_groups} def _get_floating_ip_pool_name(self, request, pool_id): - pools = [pool for pool in network.floating_ip_pools_list( + pools = [pool for pool in neutron.floating_ip_pools_list( request) if pool.id == pool_id] return pools[0].name if pools else pool_id diff --git a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tests.py b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tests.py index 2cfa5f2e..0122d973 100644 --- a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tests.py +++ b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tests.py @@ -57,9 +57,9 @@ class DataProcessingNodeGroupTests(test.TestCase): ngt.plugin_name, ngt.hadoop_version) \ .MultipleTimes().AndReturn(configs) - dash_api.network.floating_ip_pools_list(IsA(http.HttpRequest)) \ + dash_api.neutron.floating_ip_pools_list(IsA(http.HttpRequest)) \ .AndReturn([]) - dash_api.network.security_group_list(IsA(http.HttpRequest)) \ + dash_api.neutron.security_group_list(IsA(http.HttpRequest)) \ .AndReturn([]) self.mox.ReplayAll() @@ -122,7 +122,7 @@ class DataProcessingNodeGroupTests(test.TestCase): 'image_list'), dash_api.nova: ('availability_zone_list', 'flavor_list'), - dash_api.network: ('floating_ip_pools_list', + dash_api.neutron: ('floating_ip_pools_list', 'security_group_list'), dash_api.cinder: ('extension_supported', 'availability_zone_list', @@ -137,7 +137,7 @@ class DataProcessingNodeGroupTests(test.TestCase): @test.create_stubs({api.sahara: ('client', 'nodegroup_template_create', 'plugin_get_version_details'), - dash_api.network: ('floating_ip_pools_list', + dash_api.neutron: ('floating_ip_pools_list', 'security_group_list'), dash_api.nova: ('flavor_list', 'availability_zone_list'), @@ -166,9 +166,9 @@ class DataProcessingNodeGroupTests(test.TestCase): ngt.plugin_name, ngt.hadoop_version) \ .MultipleTimes().AndReturn(configs) - dash_api.network.floating_ip_pools_list(IsA(http.HttpRequest)) \ + dash_api.neutron.floating_ip_pools_list(IsA(http.HttpRequest)) \ .AndReturn([]) - dash_api.network.security_group_list(IsA(http.HttpRequest)) \ + dash_api.neutron.security_group_list(IsA(http.HttpRequest)) \ .AndReturn([]) workflow_helpers.parse_configs_from_context( IgnoreArg(), IgnoreArg()).AndReturn({}) @@ -232,7 +232,7 @@ class DataProcessingNodeGroupTests(test.TestCase): 'nodegroup_template_update', 'nodegroup_template_get', 'plugin_get_version_details'), - dash_api.network: ('floating_ip_pools_list', + dash_api.neutron: ('floating_ip_pools_list', 'security_group_list'), dash_api.nova: ('flavor_list', 'availability_zone_list'), @@ -264,9 +264,9 @@ class DataProcessingNodeGroupTests(test.TestCase): ngt.plugin_name, ngt.hadoop_version) \ .MultipleTimes().AndReturn(configs) - dash_api.network.floating_ip_pools_list(IsA(http.HttpRequest)) \ + dash_api.neutron.floating_ip_pools_list(IsA(http.HttpRequest)) \ .AndReturn([]) - dash_api.network.security_group_list(IsA(http.HttpRequest)) \ + dash_api.neutron.security_group_list(IsA(http.HttpRequest)) \ .AndReturn([]) workflow_helpers.parse_configs_from_context( IgnoreArg(), IgnoreArg()).AndReturn({}) @@ -332,7 +332,7 @@ class DataProcessingNodeGroupTests(test.TestCase): 'image_list'), dash_api.nova: ('availability_zone_list', 'flavor_list'), - dash_api.network: ('floating_ip_pools_list', + dash_api.neutron: ('floating_ip_pools_list', 'security_group_list'), dash_api.cinder: ('extension_supported', 'availability_zone_list', diff --git a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py index 4f6c8d87..6ec8365c 100644 --- a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py +++ b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py @@ -25,7 +25,7 @@ from horizon import exceptions from horizon import forms from horizon import workflows from openstack_dashboard.api import cinder -from openstack_dashboard.api import network +from openstack_dashboard.api import neutron from openstack_dashboard.dashboards.project.instances \ import utils as nova_utils from openstack_dashboard.dashboards.project.volumes \ @@ -155,7 +155,7 @@ class GeneralConfigAction(workflows.Action): workflow_helpers.get_plugin_and_hadoop_version(request)) if not saharaclient.SAHARA_AUTO_IP_ALLOCATION_ENABLED: - pools = network.floating_ip_pools_list(request) + pools = neutron.floating_ip_pools_list(request) pool_choices = [(pool.id, pool.name) for pool in pools] pool_choices.insert(0, (None, "Do not assign floating IPs")) @@ -277,7 +277,7 @@ class SecurityConfigAction(workflows.Action): initial=True) try: - groups = network.security_group_list(request) + groups = neutron.security_group_list(request) except Exception: exceptions.handle(request, _("Unable to get security group list.")) diff --git a/sahara_dashboard/content/data_processing/utils/workflow_helpers.py b/sahara_dashboard/content/data_processing/utils/workflow_helpers.py index 90a0eb60..81e464ed 100644 --- a/sahara_dashboard/content/data_processing/utils/workflow_helpers.py +++ b/sahara_dashboard/content/data_processing/utils/workflow_helpers.py @@ -21,7 +21,7 @@ import six from horizon import exceptions from horizon import forms from horizon import workflows -from openstack_dashboard.api import network +from openstack_dashboard.api import neutron from sahara_dashboard.api import sahara as saharaclient @@ -190,7 +190,7 @@ def get_security_groups(request, security_group_ids): security_groups = [] for group in security_group_ids or []: try: - security_groups.append(network.security_group_get( + security_groups.append(neutron.security_group_get( request, group)) except Exception: LOG.info(_('Unable to retrieve security group %(group)s.') %