commit b79ebc85b035166fd4ea11c00d7c829904ff66a4 Author: Akihiro Motoki Date: Sat Sep 12 10:58:20 2020 +0900 Drop remaining glance v1 related code We dropped glance v1 support in ussuri. glance v1 related tests still exist in the project instance test. Change-Id: I3079c579a1f3d42e5b02fc224f7677ea86583a7e diff --git a/openstack_dashboard/dashboards/project/instances/tests.py b/openstack_dashboard/dashboards/project/instances/tests.py index b7ef8ca..966ca43 100644 --- a/openstack_dashboard/dashboards/project/instances/tests.py +++ b/openstack_dashboard/dashboards/project/instances/tests.py @@ -2343,10 +2343,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, targets=('instances', 'cores', 'ram', 'volumes', 'gigabytes')) self._check_nova_lists(flavor_count=2) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_instance_get_glance_v1(self): - self.test_launch_instance_get() - @helpers.update_settings( OPENSTACK_HYPERVISOR_FEATURES={'can_set_password': False}) def test_launch_instance_get_without_password(self): @@ -2614,10 +2610,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, targets=('instances', 'cores', 'ram', 'volumes', 'gigabytes')) self._check_nova_lists(flavor_count=2) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_instance_get_bootable_volumes_glance_v1(self): - self.test_launch_instance_get_bootable_volumes() - @helpers.create_mocks({api.glance: ('image_list_detailed',), api.neutron: ('network_list', 'port_create', @@ -2737,10 +2729,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, self.mock_flavor_list, 2, mock.call(helpers.IsHttpRequest())) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_instance_post_glance_v1(self): - self.test_launch_instance_post() - def test_launch_instance_post_no_disk_config_supported(self): self.test_launch_instance_post(disk_config=False) @@ -2874,10 +2862,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, self.mock_flavor_list, 2, mock.call(helpers.IsHttpRequest())) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_instance_post_boot_from_volume_glance_v1(self): - self.test_launch_instance_post_boot_from_volume() - def test_launch_instance_post_boot_from_volume_with_bdmv2(self): self.test_launch_instance_post_boot_from_volume(test_with_bdmv2=True) @@ -2995,10 +2979,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, config_drive=True, scheduler_hints={}) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_lnch_inst_post_no_images_avail_boot_from_volume_glance_v1(self): - self.test_launch_instance_post_no_images_available_boot_from_volume() - @helpers.create_mocks({api.glance: ('image_list_detailed',), api.neutron: ('network_list', 'port_list_with_trunk_types', @@ -3224,10 +3204,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, helpers.IsHttpRequest(), targets=('instances', 'cores', 'ram', 'volumes', )) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_instance_post_boot_from_snapshot_glance_v1(self): - self.test_launch_instance_post_boot_from_snapshot() - def test_launch_instance_post_boot_from_snapshot_with_bdmv2(self): self.test_launch_instance_post_boot_from_snapshot(test_with_bdmv2=True) @@ -3385,10 +3361,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, self.mock_availability_zone_list.assert_called_once_with( helpers.IsHttpRequest()) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_flavorlist_error_glance_v1(self): - self.test_launch_flavorlist_error() - @helpers.create_mocks({api.glance: ('image_list_detailed',), api.neutron: ('network_list', 'port_create', @@ -3513,10 +3485,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, helpers.IsHttpRequest(), targets=('instances', 'cores', 'ram', 'volumes', )) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_form_keystone_exception_with_glance_v1(self): - self.test_launch_form_keystone_exception() - @helpers.create_mocks({api.glance: ('image_list_detailed',), api.neutron: ('network_list', 'port_list_with_trunk_types', @@ -3608,10 +3576,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, ]) self.assertEqual(2, self.mock_tenant_quota_usages.call_count) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_form_instance_count_error_glance_v1(self): - self.test_launch_form_instance_count_error() - @helpers.create_mocks({api.glance: ('image_list_detailed',), api.neutron: ('network_list', 'port_list_with_trunk_types', @@ -3724,10 +3688,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, def test_launch_form_cores_count_error_glance_v2(self): self._test_launch_form_count_error('cores', 1) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_form_cores_count_error_glance_v1(self): - self._test_launch_form_count_error('cores', 1) - def test_launch_form_ram_count_error(self): self._test_launch_form_count_error('ram', 512) @@ -3832,10 +3792,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, msg = "The flavor '%s' is too small" % flavor.name self.assertContains(res, msg) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_form_instance_requirement_error_disk_glance_v1(self): - self.test_launch_form_instance_requirement_error_disk() - def test_launch_form_instance_requirement_error_ram(self): flavor = self.flavors.first() image = self.versioned_images.first() @@ -4027,17 +3983,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, ) @helpers.update_settings( - OPENSTACK_HYPERVISOR_FEATURES={'can_set_mount_point': True}, - OPENSTACK_API_VERSIONS={'image': 1} - ) - def test_launch_form_instance_device_name_showed_glance_v1(self): - self._test_launch_form_instance_show_device_name( - u'vda', widgets.TextInput, { - 'name': 'device_name', 'value': 'vda', - 'attrs': {'id': 'id_device_name'}} - ) - - @helpers.update_settings( OPENSTACK_HYPERVISOR_FEATURES={'can_set_mount_point': False}) def test_launch_form_instance_device_name_hidden(self): self._test_launch_form_instance_show_device_name( @@ -4167,10 +4112,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, image.name) self._test_launch_form_instance_volume_size(image, volume_size, msg) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_form_instance_volume_size_error_glance_v1(self): - self.test_launch_form_instance_volume_size_error() - def test_launch_form_instance_non_int_volume_size(self): image = self.versioned_images.get(name='protected_images') msg = "Enter a whole number." @@ -4430,10 +4371,6 @@ class InstanceLaunchInstanceTests(InstanceTestBase, disk_config=u'', scheduler_hints={}) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_launch_with_empty_device_name_allowed_glance_v1(self): - self.test_launch_with_empty_device_name_allowed() - class InstanceTests2(InstanceTestBase, InstanceTableTestMixin): @@ -4548,10 +4485,6 @@ class InstanceTests2(InstanceTestBase, InstanceTableTestMixin): 'ServerGroups': 1}) self._check_nova_lists(flavor_count=2) - @override_settings(OPENSTACK_API_VERSIONS={'image': 1}) - def test_select_default_keypair_if_only_one_glance_v1(self): - self.test_select_default_keypair_if_only_one() - @helpers.create_mocks({ api.neutron: ('floating_ip_target_list_by_instance', 'tenant_floating_ip_list',