summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-12-02 23:27:46 +0000
committerGerrit Code Review <review@openstack.org>2015-12-02 23:27:46 +0000
commitf56476c2e1078e236d6ae4071214513aa4726924 (patch)
treed32bde821808d6dad561cc8f6ca70df875e5d616
parentb51f0eef3ab74f7dff5f19a622c1254d1ea68e7c (diff)
parent5fc26b0a117439bc6f07ab527ca20716511947ca (diff)
Merge "Replace "Terminate Instance" with "Delete Instance""
-rw-r--r--horizon/static/horizon/js/horizon.instances.js6
-rw-r--r--horizon/static/horizon/js/horizon.networktopology.js2
-rw-r--r--openstack_dashboard/contrib/trove/content/database_clusters/tables.py18
-rw-r--r--openstack_dashboard/contrib/trove/content/databases/tables.py18
-rw-r--r--openstack_dashboard/dashboards/admin/instances/tables.py4
-rw-r--r--openstack_dashboard/dashboards/project/instances/tables.py20
-rw-r--r--openstack_dashboard/dashboards/project/instances/templates/instances/_instance_flavor.html2
-rw-r--r--openstack_dashboard/dashboards/project/instances/tests.py12
-rw-r--r--openstack_dashboard/dashboards/project/instances/workflows/create_instance.py25
-rw-r--r--openstack_dashboard/dashboards/project/network_topology/instances/tables.py2
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js8
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js8
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js2
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js2
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.help.html6
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.html8
-rw-r--r--openstack_dashboard/static/dashboard/scss/horizon.scss2
-rw-r--r--openstack_dashboard/test/integration_tests/pages/project/compute/instancespage.py36
-rw-r--r--openstack_dashboard/test/integration_tests/tests/test_instances.py8
-rw-r--r--openstack_dashboard/usage/base.py14
-rw-r--r--openstack_dashboard/usage/views.py2
21 files changed, 104 insertions, 101 deletions
diff --git a/horizon/static/horizon/js/horizon.instances.js b/horizon/static/horizon/js/horizon.instances.js
index c0d61eb..22d3b89 100644
--- a/horizon/static/horizon/js/horizon.instances.js
+++ b/horizon/static/horizon/js/horizon.instances.js
@@ -182,13 +182,13 @@ horizon.addInitFunction(horizon.instances.init = function () {
182 elements_list = "#id_instance_snapshot_id"; 182 elements_list = "#id_instance_snapshot_id";
183 break; 183 break;
184 case "volume_id": 184 case "volume_id":
185 elements_list = "#id_volume_id, #id_device_name, #id_delete_on_terminate"; 185 elements_list = "#id_volume_id, #id_device_name, #id_vol_delete_on_instance_delete";
186 break; 186 break;
187 case "volume_image_id": 187 case "volume_image_id":
188 elements_list = "#id_image_id, #id_volume_size, #id_device_name, #id_delete_on_terminate"; 188 elements_list = "#id_image_id, #id_volume_size, #id_device_name, #id_vol_delete_on_instance_delete";
189 break; 189 break;
190 case "volume_snapshot_id": 190 case "volume_snapshot_id":
191 elements_list = "#id_volume_snapshot_id, #id_device_name, #id_delete_on_terminate"; 191 elements_list = "#id_volume_snapshot_id, #id_device_name, #id_vol_delete_on_instance_delete";
192 break; 192 break;
193 } 193 }
194 var elements_list_group = $(elements_list).closest(".form-group"); 194 var elements_list_group = $(elements_list).closest(".form-group");
diff --git a/horizon/static/horizon/js/horizon.networktopology.js b/horizon/static/horizon/js/horizon.networktopology.js
index 76a8fb1..24050d5 100644
--- a/horizon/static/horizon/js/horizon.networktopology.js
+++ b/horizon/static/horizon/js/horizon.networktopology.js
@@ -986,7 +986,7 @@ horizon.network_topology = {
986 table2:portTmpl 986 table2:portTmpl
987 }); 987 });
988 } else if (d instanceof Server) { 988 } else if (d instanceof Server) {
989 htmlData.delete_label = gettext('Terminate Instance'); 989 htmlData.delete_label = gettext('Delete Instance');
990 htmlData.view_details_label = gettext('View Instance Details'); 990 htmlData.view_details_label = gettext('View Instance Details');
991 htmlData.console_id = d.id; 991 htmlData.console_id = d.id;
992 htmlData.ips = d.ip_addresses; 992 htmlData.ips = d.ip_addresses;
diff --git a/openstack_dashboard/contrib/trove/content/database_clusters/tables.py b/openstack_dashboard/contrib/trove/content/database_clusters/tables.py
index 4e9f162..e52008b 100644
--- a/openstack_dashboard/contrib/trove/content/database_clusters/tables.py
+++ b/openstack_dashboard/contrib/trove/content/database_clusters/tables.py
@@ -29,25 +29,25 @@ from openstack_dashboard.contrib.trove.content.databases import db_capability
29ACTIVE_STATES = ("ACTIVE",) 29ACTIVE_STATES = ("ACTIVE",)
30 30
31 31
32class TerminateCluster(tables.BatchAction): 32class DeleteCluster(tables.BatchAction):
33 name = "terminate" 33 name = "delete"
34 icon = "remove" 34 icon = "remove"
35 classes = ('btn-danger',) 35 classes = ('btn-danger',)
36 help_text = _("Terminated cluster is not recoverable.") 36 help_text = _("Deleted cluster is not recoverable.")
37 37
38 @staticmethod 38 @staticmethod
39 def action_present(count): 39 def action_present(count):
40 return ungettext_lazy( 40 return ungettext_lazy(
41 u"Terminate Cluster", 41 u"Delete Cluster",
42 u"Terminate Clusters", 42 u"Delete Clusters",
43 count 43 count
44 ) 44 )
45 45
46 @staticmethod 46 @staticmethod
47 def action_past(count): 47 def action_past(count):
48 return ungettext_lazy( 48 return ungettext_lazy(
49 u"Scheduled termination of Cluster", 49 u"Scheduled deletion of Cluster",
50 u"Scheduled termination of Clusters", 50 u"Scheduled deletion of Clusters",
51 count 51 count
52 ) 52 )
53 53
@@ -159,8 +159,8 @@ class ClustersTable(tables.DataTable):
159 verbose_name = _("Clusters") 159 verbose_name = _("Clusters")
160 status_columns = ["task"] 160 status_columns = ["task"]
161 row_class = UpdateRow 161 row_class = UpdateRow
162 table_actions = (LaunchLink, TerminateCluster) 162 table_actions = (LaunchLink, DeleteCluster)
163 row_actions = (AddShard, ResetPassword, TerminateCluster) 163 row_actions = (AddShard, ResetPassword, DeleteCluster)
164 164
165 165
166def get_instance_size(instance): 166def get_instance_size(instance):
diff --git a/openstack_dashboard/contrib/trove/content/databases/tables.py b/openstack_dashboard/contrib/trove/content/databases/tables.py
index 81e305a..cb1d8d2 100644
--- a/openstack_dashboard/contrib/trove/content/databases/tables.py
+++ b/openstack_dashboard/contrib/trove/content/databases/tables.py
@@ -31,26 +31,26 @@ from openstack_dashboard.contrib.trove.content.database_backups \
31ACTIVE_STATES = ("ACTIVE",) 31ACTIVE_STATES = ("ACTIVE",)
32 32
33 33
34class TerminateInstance(tables.BatchAction): 34class DeleteInstance(tables.BatchAction):
35 help_text = _("Terminated instances are not recoverable.") 35 help_text = _("Deleted instances are not recoverable.")
36 36
37 @staticmethod 37 @staticmethod
38 def action_present(count): 38 def action_present(count):
39 return ungettext_lazy( 39 return ungettext_lazy(
40 u"Terminate Instance", 40 u"Delete Instance",
41 u"Terminate Instances", 41 u"Delete Instances",
42 count 42 count
43 ) 43 )
44 44
45 @staticmethod 45 @staticmethod
46 def action_past(count): 46 def action_past(count):
47 return ungettext_lazy( 47 return ungettext_lazy(
48 u"Scheduled termination of Instance", 48 u"Scheduled deletion of Instance",
49 u"Scheduled termination of Instances", 49 u"Scheduled deletion of Instances",
50 count 50 count
51 ) 51 )
52 52
53 name = "terminate" 53 name = "delete"
54 classes = ("btn-danger", ) 54 classes = ("btn-danger", )
55 icon = "remove" 55 icon = "remove"
56 56
@@ -340,13 +340,13 @@ class InstancesTable(tables.DataTable):
340 verbose_name = _("Instances") 340 verbose_name = _("Instances")
341 status_columns = ["status"] 341 status_columns = ["status"]
342 row_class = UpdateRow 342 row_class = UpdateRow
343 table_actions = (LaunchLink, TerminateInstance) 343 table_actions = (LaunchLink, DeleteInstance)
344 row_actions = (CreateBackup, 344 row_actions = (CreateBackup,
345 ResizeVolume, 345 ResizeVolume,
346 ResizeInstance, 346 ResizeInstance,
347 RestartInstance, 347 RestartInstance,
348 DetachReplica, 348 DetachReplica,
349 TerminateInstance) 349 DeleteInstance)
350 350
351 351
352class UsersTable(tables.DataTable): 352class UsersTable(tables.DataTable):
diff --git a/openstack_dashboard/dashboards/admin/instances/tables.py b/openstack_dashboard/dashboards/admin/instances/tables.py
index fcf192b..3ff1c7b 100644
--- a/openstack_dashboard/dashboards/admin/instances/tables.py
+++ b/openstack_dashboard/dashboards/admin/instances/tables.py
@@ -171,7 +171,7 @@ class AdminInstancesTable(tables.DataTable):
171 name = "instances" 171 name = "instances"
172 verbose_name = _("Instances") 172 verbose_name = _("Instances")
173 status_columns = ["status", "task"] 173 status_columns = ["status", "task"]
174 table_actions = (project_tables.TerminateInstance, 174 table_actions = (project_tables.DeleteInstance,
175 AdminInstanceFilterAction) 175 AdminInstanceFilterAction)
176 row_class = AdminUpdateRow 176 row_class = AdminUpdateRow
177 row_actions = (project_tables.ConfirmResize, 177 row_actions = (project_tables.ConfirmResize,
@@ -187,4 +187,4 @@ class AdminInstancesTable(tables.DataTable):
187 LiveMigrateInstance, 187 LiveMigrateInstance,
188 project_tables.SoftRebootInstance, 188 project_tables.SoftRebootInstance,
189 project_tables.RebootInstance, 189 project_tables.RebootInstance,
190 project_tables.TerminateInstance) 190 project_tables.DeleteInstance)
diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py
index 4b40c97..eaeec5e 100644
--- a/openstack_dashboard/dashboards/project/instances/tables.py
+++ b/openstack_dashboard/dashboards/project/instances/tables.py
@@ -81,31 +81,31 @@ def is_deleting(instance):
81 return task_state.lower() == "deleting" 81 return task_state.lower() == "deleting"
82 82
83 83
84class TerminateInstance(policy.PolicyTargetMixin, tables.BatchAction): 84class DeleteInstance(policy.PolicyTargetMixin, tables.BatchAction):
85 name = "terminate" 85 name = "delete"
86 classes = ("btn-danger",) 86 classes = ("btn-danger",)
87 icon = "remove" 87 icon = "remove"
88 policy_rules = (("compute", "compute:delete"),) 88 policy_rules = (("compute", "compute:delete"),)
89 help_text = _("Terminated instances are not recoverable.") 89 help_text = _("Deleted instances are not recoverable.")
90 90
91 @staticmethod 91 @staticmethod
92 def action_present(count): 92 def action_present(count):
93 return ungettext_lazy( 93 return ungettext_lazy(
94 u"Terminate Instance", 94 u"Delete Instance",
95 u"Terminate Instances", 95 u"Delete Instances",
96 count 96 count
97 ) 97 )
98 98
99 @staticmethod 99 @staticmethod
100 def action_past(count): 100 def action_past(count):
101 return ungettext_lazy( 101 return ungettext_lazy(
102 u"Scheduled termination of Instance", 102 u"Scheduled deletion of Instance",
103 u"Scheduled termination of Instances", 103 u"Scheduled deletion of Instances",
104 count 104 count
105 ) 105 )
106 106
107 def allowed(self, request, instance=None): 107 def allowed(self, request, instance=None):
108 """Allow terminate action if instance not currently being deleted.""" 108 """Allow delete action if instance not currently being deleted."""
109 return not is_deleting(instance) 109 return not is_deleting(instance)
110 110
111 def action(self, request, obj_id): 111 def action(self, request, obj_id):
@@ -1172,7 +1172,7 @@ class InstancesTable(tables.DataTable):
1172 launch_actions = (LaunchLink,) + launch_actions 1172 launch_actions = (LaunchLink,) + launch_actions
1173 if getattr(settings, 'LAUNCH_INSTANCE_NG_ENABLED', False): 1173 if getattr(settings, 'LAUNCH_INSTANCE_NG_ENABLED', False):
1174 launch_actions = (LaunchLinkNG,) + launch_actions 1174 launch_actions = (LaunchLinkNG,) + launch_actions
1175 table_actions = launch_actions + (TerminateInstance, 1175 table_actions = launch_actions + (DeleteInstance,
1176 InstancesFilterAction) 1176 InstancesFilterAction)
1177 row_actions = (StartInstance, ConfirmResize, RevertResize, 1177 row_actions = (StartInstance, ConfirmResize, RevertResize,
1178 CreateSnapshot, SimpleAssociateIP, AssociateIP, 1178 CreateSnapshot, SimpleAssociateIP, AssociateIP,
@@ -1182,4 +1182,4 @@ class InstancesTable(tables.DataTable):
1182 ConsoleLink, LogLink, TogglePause, ToggleSuspend, 1182 ConsoleLink, LogLink, TogglePause, ToggleSuspend,
1183 ToggleShelve, ResizeLink, LockInstance, UnlockInstance, 1183 ToggleShelve, ResizeLink, LockInstance, UnlockInstance,
1184 SoftRebootInstance, RebootInstance, 1184 SoftRebootInstance, RebootInstance,
1185 StopInstance, RebuildInstance, TerminateInstance) 1185 StopInstance, RebuildInstance, DeleteInstance)
diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_instance_flavor.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_instance_flavor.html
index 7042b79..476ef8c 100644
--- a/openstack_dashboard/dashboards/project/instances/templates/instances/_instance_flavor.html
+++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_instance_flavor.html
@@ -10,7 +10,7 @@
10<script type="text/javascript" charset="utf-8"> 10<script type="text/javascript" charset="utf-8">
11$(function () { 11$(function () {
12 var $flavor = $("#flavor_details_{{ id }}"); 12 var $flavor = $("#flavor_details_{{ id }}");
13 // NOTE(tsufiev): check this in case this template is used in network topology -> terminate instance 13 // NOTE(tsufiev): check this in case this template is used in network topology -> delete instance
14 if ( $flavor.popover ) { 14 if ( $flavor.popover ) {
15 $flavor.popover({html:true}); 15 $flavor.popover({html:true});
16 } 16 }
diff --git a/openstack_dashboard/dashboards/project/instances/tests.py b/openstack_dashboard/dashboards/project/instances/tests.py
index 637b6df..2708e59 100644
--- a/openstack_dashboard/dashboards/project/instances/tests.py
+++ b/openstack_dashboard/dashboards/project/instances/tests.py
@@ -242,7 +242,7 @@ class InstanceTests(helpers.TestCase):
242 'server_delete',), 242 'server_delete',),
243 api.glance: ('image_list_detailed',), 243 api.glance: ('image_list_detailed',),
244 api.network: ('servers_update_addresses',)}) 244 api.network: ('servers_update_addresses',)})
245 def test_terminate_instance(self): 245 def test_delete_instance(self):
246 servers = self.servers.list() 246 servers = self.servers.list()
247 server = servers[0] 247 server = servers[0]
248 248
@@ -256,7 +256,7 @@ class InstanceTests(helpers.TestCase):
256 api.nova.server_delete(IsA(http.HttpRequest), server.id) 256 api.nova.server_delete(IsA(http.HttpRequest), server.id)
257 self.mox.ReplayAll() 257 self.mox.ReplayAll()
258 258
259 formData = {'action': 'instances__terminate__%s' % server.id} 259 formData = {'action': 'instances__delete__%s' % server.id}
260 res = self.client.post(INDEX_URL, formData) 260 res = self.client.post(INDEX_URL, formData)
261 261
262 self.assertRedirectsNoFollow(res, INDEX_URL) 262 self.assertRedirectsNoFollow(res, INDEX_URL)
@@ -266,7 +266,7 @@ class InstanceTests(helpers.TestCase):
266 'server_delete',), 266 'server_delete',),
267 api.glance: ('image_list_detailed',), 267 api.glance: ('image_list_detailed',),
268 api.network: ('servers_update_addresses',)}) 268 api.network: ('servers_update_addresses',)})
269 def test_terminate_instance_exception(self): 269 def test_delete_instance_exception(self):
270 servers = self.servers.list() 270 servers = self.servers.list()
271 server = servers[0] 271 server = servers[0]
272 272
@@ -282,7 +282,7 @@ class InstanceTests(helpers.TestCase):
282 282
283 self.mox.ReplayAll() 283 self.mox.ReplayAll()
284 284
285 formData = {'action': 'instances__terminate__%s' % server.id} 285 formData = {'action': 'instances__delete__%s' % server.id}
286 res = self.client.post(INDEX_URL, formData) 286 res = self.client.post(INDEX_URL, formData)
287 287
288 self.assertRedirectsNoFollow(res, INDEX_URL) 288 self.assertRedirectsNoFollow(res, INDEX_URL)
@@ -4384,7 +4384,7 @@ class InstanceTests(helpers.TestCase):
4384 'server_delete',), 4384 'server_delete',),
4385 api.glance: ('image_list_detailed',), 4385 api.glance: ('image_list_detailed',),
4386 api.network: ('servers_update_addresses',)}) 4386 api.network: ('servers_update_addresses',)})
4387 def test_terminate_instance_with_pagination(self): 4387 def test_delete_instance_with_pagination(self):
4388 """Instance should be deleted from 4388 """Instance should be deleted from
4389 the next page. 4389 the next page.
4390 """ 4390 """
@@ -4408,7 +4408,7 @@ class InstanceTests(helpers.TestCase):
4408 servers[page_size - 1].id]) 4408 servers[page_size - 1].id])
4409 next_page_url = "?".join([reverse('horizon:project:instances:index'), 4409 next_page_url = "?".join([reverse('horizon:project:instances:index'),
4410 params]) 4410 params])
4411 formData = {'action': 'instances__terminate__%s' % server.id} 4411 formData = {'action': 'instances__delete__%s' % server.id}
4412 res = self.client.post(next_page_url, formData) 4412 res = self.client.post(next_page_url, formData)
4413 4413
4414 self.assertRedirectsNoFollow(res, next_page_url) 4414 self.assertRedirectsNoFollow(res, next_page_url)
diff --git a/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py b/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py
index 154f144..46311f1 100644
--- a/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py
+++ b/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py
@@ -128,11 +128,11 @@ class SetInstanceDetailsAction(workflows.Action):
128 "system choose a device name " 128 "system choose a device name "
129 "for you.")) 129 "for you."))
130 130
131 delete_on_terminate = forms.BooleanField(label=_("Delete on Terminate"), 131 vol_delete_on_instance_delete = forms.BooleanField(
132 initial=False, 132 label=_("Delete Volume on Instance Delete"),
133 required=False, 133 initial=False,
134 help_text=_("Delete volume on " 134 required=False,
135 "instance terminate")) 135 help_text=_("Delete volume when the instance is deleted"))
136 136
137 class Meta(object): 137 class Meta(object):
138 name = _("Details") 138 name = _("Details")
@@ -507,7 +507,7 @@ class SetInstanceDetails(workflows.Step):
507 contributes = ("source_type", "source_id", 507 contributes = ("source_type", "source_id",
508 "availability_zone", "name", "count", "flavor", 508 "availability_zone", "name", "count", "flavor",
509 "device_name", # Can be None for an image. 509 "device_name", # Can be None for an image.
510 "delete_on_terminate") 510 "vol_delete_on_instance_delete")
511 511
512 def prepare_action_context(self, request, context): 512 def prepare_action_context(self, request, context):
513 if 'source_type' in context and 'source_id' in context: 513 if 'source_type' in context and 'source_id' in context:
@@ -884,17 +884,18 @@ class LaunchInstance(workflows.Workflow):
884 'source_type': dev_source_type_mapping[source_type], 884 'source_type': dev_source_type_mapping[source_type],
885 'destination_type': 'volume', 885 'destination_type': 'volume',
886 'delete_on_termination': 886 'delete_on_termination':
887 bool(context['delete_on_terminate']), 887 bool(context['vol_delete_on_instance_delete']),
888 'uuid': volume_source_id, 888 'uuid': volume_source_id,
889 'boot_index': '0', 889 'boot_index': '0',
890 'volume_size': context['volume_size'] 890 'volume_size': context['volume_size']
891 } 891 }
892 ] 892 ]
893 else: 893 else:
894 dev_mapping_1 = {context['device_name']: '%s::%s' % 894 dev_mapping_1 = {
895 (context['source_id'], 895 context['device_name']: '%s::%s' %
896 bool(context['delete_on_terminate'])) 896 (context['source_id'],
897 } 897 bool(context['vol_delete_on_instance_delete']))
898 }
898 except Exception: 899 except Exception:
899 msg = _('Unable to retrieve extensions information') 900 msg = _('Unable to retrieve extensions information')
900 exceptions.handle(request, msg) 901 exceptions.handle(request, msg)
@@ -906,7 +907,7 @@ class LaunchInstance(workflows.Workflow):
906 'source_type': 'image', 907 'source_type': 'image',
907 'destination_type': 'volume', 908 'destination_type': 'volume',
908 'delete_on_termination': 909 'delete_on_termination':
909 bool(context['delete_on_terminate']), 910 bool(context['vol_delete_on_instance_delete']),
910 'uuid': context['source_id'], 911 'uuid': context['source_id'],
911 'boot_index': '0', 912 'boot_index': '0',
912 'volume_size': context['volume_size'] 913 'volume_size': context['volume_size']
diff --git a/openstack_dashboard/dashboards/project/network_topology/instances/tables.py b/openstack_dashboard/dashboards/project/network_topology/instances/tables.py
index 6d26acd..865a1bb 100644
--- a/openstack_dashboard/dashboards/project/network_topology/instances/tables.py
+++ b/openstack_dashboard/dashboards/project/network_topology/instances/tables.py
@@ -22,5 +22,5 @@ class InstancesTable(tables.InstancesTable):
22 name = "instances" 22 name = "instances"
23 verbose_name = _("Instances") 23 verbose_name = _("Instances")
24 row_actions = ( 24 row_actions = (
25 tables.TerminateInstance, 25 tables.DeleteInstance,
26 ) 26 )
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js
index 521551a..b6ba3a0 100644
--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js
+++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js
@@ -160,7 +160,7 @@
160 vol_create: false, 160 vol_create: false,
161 // May be null 161 // May be null
162 vol_device_name: 'vda', 162 vol_device_name: 'vda',
163 vol_delete_on_terminate: false, 163 vol_delete_on_instance_delete: false,
164 vol_size: 1 164 vol_size: 1
165 }; 165 };
166 } 166 }
@@ -472,7 +472,7 @@
472 delete finalSpec.source_type; 472 delete finalSpec.source_type;
473 delete finalSpec.vol_create; 473 delete finalSpec.vol_create;
474 delete finalSpec.vol_device_name; 474 delete finalSpec.vol_device_name;
475 delete finalSpec.vol_delete_on_terminate; 475 delete finalSpec.vol_delete_on_instance_delete;
476 delete finalSpec.vol_size; 476 delete finalSpec.vol_size;
477 } 477 }
478 478
@@ -486,7 +486,7 @@
486 'device_name': deviceName, 486 'device_name': deviceName,
487 'source_type': SOURCE_TYPE_IMAGE, 487 'source_type': SOURCE_TYPE_IMAGE,
488 'destination_type': SOURCE_TYPE_VOLUME, 488 'destination_type': SOURCE_TYPE_VOLUME,
489 'delete_on_termination': finalSpec.vol_delete_on_terminate, 489 'delete_on_termination': finalSpec.vol_delete_on_instance_delete,
490 'uuid': finalSpec.source_id, 490 'uuid': finalSpec.source_id,
491 'boot_index': '0', 491 'boot_index': '0',
492 'volume_size': finalSpec.vol_size 492 'volume_size': finalSpec.vol_size
@@ -503,7 +503,7 @@
503 ':', 503 ':',
504 sourceType, 504 sourceType,
505 '::', 505 '::',
506 finalSpec.vol_delete_on_terminate 506 finalSpec.vol_delete_on_instance_delete
507 ].join(''); 507 ].join('');
508 508
509 // Source ID must be empty for API 509 // Source ID must be empty for API
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js
index b90b7c7..8091527 100644
--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js
+++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js
@@ -373,7 +373,7 @@
373 it('sets volume options appropriately', function() { 373 it('sets volume options appropriately', function() {
374 expect(model.newInstanceSpec.vol_create).toBe(false); 374 expect(model.newInstanceSpec.vol_create).toBe(false);
375 expect(model.newInstanceSpec.vol_device_name).toBe('vda'); 375 expect(model.newInstanceSpec.vol_device_name).toBe('vda');
376 expect(model.newInstanceSpec.vol_delete_on_terminate).toBe(false); 376 expect(model.newInstanceSpec.vol_delete_on_instance_delete).toBe(false);
377 expect(model.newInstanceSpec.vol_size).toBe(1); 377 expect(model.newInstanceSpec.vol_size).toBe(1);
378 }); 378 });
379 379
@@ -391,7 +391,7 @@
391 model.newInstanceSpec.security_groups = [ { id: 'adminId', name: 'admin' }, 391 model.newInstanceSpec.security_groups = [ { id: 'adminId', name: 'admin' },
392 { id: 'demoId', name: 'demo' } ]; 392 { id: 'demoId', name: 'demo' } ];
393 model.newInstanceSpec.vol_create = true; 393 model.newInstanceSpec.vol_create = true;
394 model.newInstanceSpec.vol_delete_on_terminate = true; 394 model.newInstanceSpec.vol_delete_on_instance_delete = true;
395 model.newInstanceSpec.vol_device_name = "volTestName"; 395 model.newInstanceSpec.vol_device_name = "volTestName";
396 model.newInstanceSpec.vol_size = 10; 396 model.newInstanceSpec.vol_size = 10;
397 }); 397 });
@@ -442,7 +442,7 @@
442 it('should handle source type of "volume"', function() { 442 it('should handle source type of "volume"', function() {
443 model.newInstanceSpec.source_type.type = 'volume'; 443 model.newInstanceSpec.source_type.type = 'volume';
444 model.newInstanceSpec.source[0].id = 'imAnID'; 444 model.newInstanceSpec.source[0].id = 'imAnID';
445 model.newInstanceSpec.vol_delete_on_terminate = 'yep'; 445 model.newInstanceSpec.vol_delete_on_instance_delete = 'yep';
446 446
447 var finalSpec = model.createInstance(); 447 var finalSpec = model.createInstance();
448 expect(finalSpec.block_device_mapping.volTestName) 448 expect(finalSpec.block_device_mapping.volTestName)
@@ -461,7 +461,7 @@
461 it('should handle source type of "volume_snapshot"', function() { 461 it('should handle source type of "volume_snapshot"', function() {
462 model.newInstanceSpec.source_type.type = 'volume_snapshot'; 462 model.newInstanceSpec.source_type.type = 'volume_snapshot';
463 model.newInstanceSpec.source[0].id = 'imAnID'; 463 model.newInstanceSpec.source[0].id = 'imAnID';
464 model.newInstanceSpec.vol_delete_on_terminate = 'yep'; 464 model.newInstanceSpec.vol_delete_on_instance_delete = 'yep';
465 465
466 var finalSpec = model.createInstance(); 466 var finalSpec = model.createInstance();
467 expect(finalSpec.block_device_mapping.volTestName) 467 expect(finalSpec.block_device_mapping.volTestName)
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js
index 1a2f155..2486e52 100644
--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js
+++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js
@@ -240,7 +240,7 @@
240 function updateBootSourceSelection(selectedSource) { 240 function updateBootSourceSelection(selectedSource) {
241 ctrl.currentBootSource = selectedSource; 241 ctrl.currentBootSource = selectedSource;
242 $scope.model.newInstanceSpec.vol_create = false; 242 $scope.model.newInstanceSpec.vol_create = false;
243 $scope.model.newInstanceSpec.vol_delete_on_terminate = false; 243 $scope.model.newInstanceSpec.vol_delete_on_instance_delete = false;
244 changeBootSource(selectedSource); 244 changeBootSource(selectedSource);
245 validateBootSourceType(); 245 validateBootSourceType();
246 } 246 }
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js
index 70d2ebc..b8865b4 100644
--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js
+++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js
@@ -137,7 +137,7 @@
137 137
138 expect(ctrl.currentBootSource).toEqual('image'); 138 expect(ctrl.currentBootSource).toEqual('image');
139 expect(scope.model.newInstanceSpec.vol_create).toBe(false); 139 expect(scope.model.newInstanceSpec.vol_create).toBe(false);
140 expect(scope.model.newInstanceSpec.vol_delete_on_terminate).toBe(false); 140 expect(scope.model.newInstanceSpec.vol_delete_on_instance_delete).toBe(false);
141 141
142 // check table data 142 // check table data
143 expect(ctrl.tableData).toBeDefined(); 143 expect(ctrl.tableData).toBeDefined();
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.help.html b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.help.html
index 4dfee6a..d024fa3 100644
--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.help.html
+++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.help.html
@@ -6,8 +6,8 @@
6 <p translate><li><b>Image</b>: This option uses an image to boot the instance.</li></p> 6 <p translate><li><b>Image</b>: This option uses an image to boot the instance.</li></p>
7 <p translate><li><b>Instance Snapshot</b>: This option uses an instance snapshot to boot the instance.</li></p> 7 <p translate><li><b>Instance Snapshot</b>: This option uses an instance snapshot to boot the instance.</li></p>
8 <p translate>If you want to create an instance that uses persistent storage, meaning the instance data is saved when the instance is deleted, then select one of the following boot options:</p> 8 <p translate>If you want to create an instance that uses persistent storage, meaning the instance data is saved when the instance is deleted, then select one of the following boot options:</p>
9 <p translate><li><b>Image (with Create New Volume checked)</b>: This options uses an image to boot the instance, and creates a new volume to persist instance data. You can specify volume size and whether to delete the volume on termination of the instance.</li></p> 9 <p translate><li><b>Image (with Create New Volume checked)</b>: This options uses an image to boot the instance, and creates a new volume to persist instance data. You can specify volume size and whether to delete the volume on deletion of the instance.</li></p>
10 <p translate><li><b>Volume</b>: This option uses a volume that already exists. It does not create a new volume. You can choose to delete the volume on termination of the instance. <em>Note: when selecting Volume, you can only launch one instance.</em></li></p> 10 <p translate><li><b>Volume</b>: This option uses a volume that already exists. It does not create a new volume. You can choose to delete the volume on deletion of the instance. <em>Note: when selecting Volume, you can only launch one instance.</em></li></p>
11 <p translate><li><b>Volume Snapshot</b>: This option uses a volume snapshot to boot the instance, and creates a new volume to persist instance data. You can choose to delete the volume on termination of the instance.</li></p> 11 <p translate><li><b>Volume Snapshot</b>: This option uses a volume snapshot to boot the instance, and creates a new volume to persist instance data. You can choose to delete the volume on deletion of the instance.</li></p>
12 12
13</div> 13</div>
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.html b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.html
index b0fac26..fc84e74 100644
--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.html
+++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.html
@@ -77,12 +77,12 @@
77 77
78 <div class="col-xs-12 col-sm-4" ng-if="model.newInstanceSpec.vol_create == true"> 78 <div class="col-xs-12 col-sm-4" ng-if="model.newInstanceSpec.vol_create == true">
79 <div class="form-group delete-volume"> 79 <div class="form-group delete-volume">
80 <label translate class="on-top">Delete Volume on Terminate</label> 80 <label translate class="on-top">Delete Volume on Instance Delete</label>
81 <div class="form-field"> 81 <div class="form-field">
82 <div class="btn-group"> 82 <div class="btn-group">
83 <label class="btn btn-toggle" 83 <label class="btn btn-toggle"
84 ng-repeat="option in ctrl.toggleButtonOptions" 84 ng-repeat="option in ctrl.toggleButtonOptions"
85 ng-model="model.newInstanceSpec.vol_delete_on_terminate" 85 ng-model="model.newInstanceSpec.vol_delete_on_instance_delete"
86 btn-radio="option.value">{$ ::option.label $}</label> 86 btn-radio="option.value">{$ ::option.label $}</label>
87 </div> 87 </div>
88 </div> 88 </div>
@@ -96,12 +96,12 @@
96 <div class="col-xs-12 col-sm-6"> 96 <div class="col-xs-12 col-sm-6">
97 97
98 <div class="form-group delete-volume"> 98 <div class="form-group delete-volume">
99 <label translate class="on-top">Delete Volume on Terminate</label> 99 <label translate class="on-top">Delete Volume on Instance Delete</label>
100 <div class="form-field"> 100 <div class="form-field">
101 <div class="btn-group"> 101 <div class="btn-group">
102 <label class="btn btn-toggle" 102 <label class="btn btn-toggle"
103 ng-repeat="option in ctrl.toggleButtonOptions" 103 ng-repeat="option in ctrl.toggleButtonOptions"
104 ng-model="model.newInstanceSpec.vol_delete_on_terminate" 104 ng-model="model.newInstanceSpec.vol_delete_on_instance_delete"
105 btn-radio="option.value">{$ ::option.label $}</label> 105 btn-radio="option.value">{$ ::option.label $}</label>
106 </div> 106 </div>
107 </div> 107 </div>
diff --git a/openstack_dashboard/static/dashboard/scss/horizon.scss b/openstack_dashboard/static/dashboard/scss/horizon.scss
index 01a82cd..d69149e 100644
--- a/openstack_dashboard/static/dashboard/scss/horizon.scss
+++ b/openstack_dashboard/static/dashboard/scss/horizon.scss
@@ -545,7 +545,7 @@ div.input input[type="checkbox"] {
545 width: 25px; 545 width: 25px;
546} 546}
547 547
548tr.terminated { 548tr.deleted {
549 color: #999999; 549 color: #999999;
550} 550}
551 551
diff --git a/openstack_dashboard/test/integration_tests/pages/project/compute/instancespage.py b/openstack_dashboard/test/integration_tests/pages/project/compute/instancespage.py
index 1a125b0..db53d48 100644
--- a/openstack_dashboard/test/integration_tests/pages/project/compute/instancespage.py
+++ b/openstack_dashboard/test/integration_tests/pages/project/compute/instancespage.py
@@ -25,13 +25,13 @@ class InstancesPage(basepage.BaseNavigationPage):
25 DEFAULT_VOLUME_NAME = None 25 DEFAULT_VOLUME_NAME = None
26 DEFAULT_SNAPSHOT_NAME = None 26 DEFAULT_SNAPSHOT_NAME = None
27 DEFAULT_VOLUME_SNAPSHOT_NAME = None 27 DEFAULT_VOLUME_SNAPSHOT_NAME = None
28 DEFAULT_DELETE_ON_TERMINATE = False 28 DEFAULT_VOL_DELETE_ON_INSTANCE_DELETE = False
29 DEFAULT_SECURITY_GROUP = True 29 DEFAULT_SECURITY_GROUP = True
30 30
31 _instances_table_locator = (by.By.CSS_SELECTOR, 'table#instances') 31 _instances_table_locator = (by.By.CSS_SELECTOR, 'table#instances')
32 32
33 INSTANCES_TABLE_NAME = "instances" 33 INSTANCES_TABLE_NAME = "instances"
34 INSTANCES_TABLE_ACTIONS = ("launch_ng", "launch", "terminate", 34 INSTANCES_TABLE_ACTIONS = ("launch_ng", "launch", "delete",
35 ('start', 'stop', "reboot")) 35 ('start', 'stop', "reboot"))
36 INSTANCES_TABLE_NAME_COLUMN_INDEX = 0 36 INSTANCES_TABLE_NAME_COLUMN_INDEX = 0
37 INSTANCES_TABLE_STATUS_COLUMN_INDEX = 5 37 INSTANCES_TABLE_STATUS_COLUMN_INDEX = 5
@@ -41,14 +41,14 @@ class InstancesPage(basepage.BaseNavigationPage):
41 "associate_floating_ip", "disassociate_floating_ip", 41 "associate_floating_ip", "disassociate_floating_ip",
42 "edit_instance", "edit_security_groups", "console", 42 "edit_instance", "edit_security_groups", "console",
43 "view_log", "pause", "suspend", "resize", "lock", "unlock", 43 "view_log", "pause", "suspend", "resize", "lock", "unlock",
44 "soft_reboot", "hard_reboot", "shutoff", "rebuild", "terminate") 44 "soft_reboot", "hard_reboot", "shutoff", "rebuild", "delete")
45 } 45 }
46 46
47 CREATE_INSTANCE_FORM_FIELDS = (( 47 CREATE_INSTANCE_FORM_FIELDS = ((
48 "availability_zone", "name", "flavor", 48 "availability_zone", "name", "flavor",
49 "count", "source_type", "instance_snapshot_id", 49 "count", "source_type", "instance_snapshot_id",
50 "volume_id", "volume_snapshot_id", "image_id", "volume_size", 50 "volume_id", "volume_snapshot_id", "image_id", "volume_size",
51 "delete_on_terminate"), 51 "vol_delete_on_instance_delete"),
52 ("keypair", "groups"), 52 ("keypair", "groups"),
53 ("script_source", "script_upload", "script_data"), 53 ("script_source", "script_upload", "script_data"),
54 ("disk_config", "config_drive") 54 ("disk_config", "config_drive")
@@ -88,14 +88,16 @@ class InstancesPage(basepage.BaseNavigationPage):
88 def is_instance_present(self, name): 88 def is_instance_present(self, name):
89 return bool(self._get_row_with_instance_name(name)) 89 return bool(self._get_row_with_instance_name(name))
90 90
91 def create_instance(self, instance_name, 91 def create_instance(
92 available_zone=None, 92 self, instance_name,
93 instance_count=DEFAULT_COUNT, 93 available_zone=None,
94 flavor=DEFAULT_FLAVOR, 94 instance_count=DEFAULT_COUNT,
95 boot_source=DEFAULT_BOOT_SOURCE, 95 flavor=DEFAULT_FLAVOR,
96 source_name=None, 96 boot_source=DEFAULT_BOOT_SOURCE,
97 device_size=None, 97 source_name=None,
98 delete_on_terminate=DEFAULT_DELETE_ON_TERMINATE): 98 device_size=None,
99 vol_delete_on_instance_delete=DEFAULT_VOL_DELETE_ON_INSTANCE_DELETE
100 ):
99 if not available_zone: 101 if not available_zone:
100 available_zone = self.conf.launch_instances.available_zone 102 available_zone = self.conf.launch_instances.available_zone
101 self.instances_table.launch.click() 103 self.instances_table.launch.click()
@@ -112,19 +114,19 @@ class InstancesPage(basepage.BaseNavigationPage):
112 boot_source[0].text = source_name 114 boot_source[0].text = source_name
113 if device_size: 115 if device_size:
114 instance.volume_size.value = device_size 116 instance.volume_size.value = device_size
115 if delete_on_terminate: 117 if vol_delete_on_instance_delete:
116 instance.delete_on_terminate.mark() 118 instance.vol_delete_on_instance_delete.mark()
117 instance.submit.click() 119 instance.submit.click()
118 self.wait_till_popups_disappear() 120 self.wait_till_popups_disappear()
119 121
120 def terminate_instance(self, name): 122 def delete_instance(self, name):
121 row = self._get_row_with_instance_name(name) 123 row = self._get_row_with_instance_name(name)
122 row.mark() 124 row.mark()
123 self.instances_table.terminate.click() 125 self.instances_table.delete.click()
124 self.confirm_delete_instances_form.submit.click() 126 self.confirm_delete_instances_form.submit.click()
125 self.wait_till_popups_disappear() 127 self.wait_till_popups_disappear()
126 128
127 def is_instance_terminated(self, name): 129 def is_instance_deleted(self, name):
128 try: 130 try:
129 row = self._get_row_with_instance_name(name) 131 row = self._get_row_with_instance_name(name)
130 self._wait_till_element_disappears(row) 132 self._wait_till_element_disappears(row)
diff --git a/openstack_dashboard/test/integration_tests/tests/test_instances.py b/openstack_dashboard/test/integration_tests/tests/test_instances.py
index a7398f7..8970d2e 100644
--- a/openstack_dashboard/test/integration_tests/tests/test_instances.py
+++ b/openstack_dashboard/test/integration_tests/tests/test_instances.py
@@ -17,12 +17,12 @@ INSTANCES_NAME = helpers.gen_random_resource_name('instance',
17 17
18class TestInstances(helpers.AdminTestCase): 18class TestInstances(helpers.AdminTestCase):
19 """This is a basic scenario to test: 19 """This is a basic scenario to test:
20 * Create Instance and Terminate Instance 20 * Create Instance and Delete Instance
21 """ 21 """
22 22
23 def test_create_terminate_instance(self): 23 def test_create_delete_instance(self):
24 instances_page = self.home_pg.go_to_compute_instancespage() 24 instances_page = self.home_pg.go_to_compute_instancespage()
25 instances_page.create_instance(INSTANCES_NAME) 25 instances_page.create_instance(INSTANCES_NAME)
26 self.assertTrue(instances_page.is_instance_active(INSTANCES_NAME)) 26 self.assertTrue(instances_page.is_instance_active(INSTANCES_NAME))
27 instances_page.terminate_instance(INSTANCES_NAME) 27 instances_page.delete_instance(INSTANCES_NAME)
28 self.assertTrue(instances_page.is_instance_terminated(INSTANCES_NAME)) 28 self.assertTrue(instances_page.is_instance_deleted(INSTANCES_NAME))
diff --git a/openstack_dashboard/usage/base.py b/openstack_dashboard/usage/base.py
index e516524..9afb604 100644
--- a/openstack_dashboard/usage/base.py
+++ b/openstack_dashboard/usage/base.py
@@ -26,7 +26,7 @@ from openstack_dashboard.usage import quotas
26 26
27 27
28class BaseUsage(object): 28class BaseUsage(object):
29 show_terminated = False 29 show_deleted = False
30 30
31 def __init__(self, request, project_id=None): 31 def __init__(self, request, project_id=None):
32 self.project_id = project_id or request.user.tenant_id 32 self.project_id = project_id or request.user.tenant_id
@@ -248,7 +248,7 @@ class BaseUsage(object):
248 248
249 249
250class GlobalUsage(BaseUsage): 250class GlobalUsage(BaseUsage):
251 show_terminated = True 251 show_deleted = True
252 252
253 def get_usage_list(self, start, end): 253 def get_usage_list(self, start, end):
254 return api.nova.usage_list(self.request, start, end) 254 return api.nova.usage_list(self.request, start, end)
@@ -259,10 +259,10 @@ class ProjectUsage(BaseUsage):
259 'hours', 'local_gb') 259 'hours', 'local_gb')
260 260
261 def get_usage_list(self, start, end): 261 def get_usage_list(self, start, end):
262 show_terminated = self.request.GET.get('show_terminated', 262 show_deleted = self.request.GET.get('show_deleted',
263 self.show_terminated) 263 self.show_deleted)
264 instances = [] 264 instances = []
265 terminated_instances = [] 265 deleted_instances = []
266 usage = api.nova.usage_get(self.request, self.project_id, start, end) 266 usage = api.nova.usage_get(self.request, self.project_id, start, end)
267 # Attribute may not exist if there are no instances 267 # Attribute may not exist if there are no instances
268 if hasattr(usage, 'server_usages'): 268 if hasattr(usage, 'server_usages'):
@@ -273,8 +273,8 @@ class ProjectUsage(BaseUsage):
273 server_uptime = server_usage['uptime'] 273 server_uptime = server_usage['uptime']
274 total_uptime = now - datetime.timedelta(seconds=server_uptime) 274 total_uptime = now - datetime.timedelta(seconds=server_uptime)
275 server_usage['uptime_at'] = total_uptime 275 server_usage['uptime_at'] = total_uptime
276 if server_usage['ended_at'] and not show_terminated: 276 if server_usage['ended_at'] and not show_deleted:
277 terminated_instances.append(server_usage) 277 deleted_instances.append(server_usage)
278 else: 278 else:
279 instances.append(server_usage) 279 instances.append(server_usage)
280 usage.server_usages = instances 280 usage.server_usages = instances
diff --git a/openstack_dashboard/usage/views.py b/openstack_dashboard/usage/views.py
index 6ba5af8..df22ade 100644
--- a/openstack_dashboard/usage/views.py
+++ b/openstack_dashboard/usage/views.py
@@ -20,7 +20,7 @@ from openstack_dashboard.usage import base
20 20
21class UsageView(tables.DataTableView): 21class UsageView(tables.DataTableView):
22 usage_class = None 22 usage_class = None
23 show_terminated = True 23 show_deleted = True
24 csv_template_name = None 24 csv_template_name = None
25 page_title = _("Overview") 25 page_title = _("Overview")
26 26