Browse Source

Merge "Replace "Terminate Instance" with "Delete Instance""

tags/9.0.0.0b1
Jenkins 3 years ago
parent
commit
f56476c2e1
21 changed files with 104 additions and 101 deletions
  1. 3
    3
      horizon/static/horizon/js/horizon.instances.js
  2. 1
    1
      horizon/static/horizon/js/horizon.networktopology.js
  3. 9
    9
      openstack_dashboard/contrib/trove/content/database_clusters/tables.py
  4. 9
    9
      openstack_dashboard/contrib/trove/content/databases/tables.py
  5. 2
    2
      openstack_dashboard/dashboards/admin/instances/tables.py
  6. 10
    10
      openstack_dashboard/dashboards/project/instances/tables.py
  7. 1
    1
      openstack_dashboard/dashboards/project/instances/templates/instances/_instance_flavor.html
  8. 6
    6
      openstack_dashboard/dashboards/project/instances/tests.py
  9. 13
    12
      openstack_dashboard/dashboards/project/instances/workflows/create_instance.py
  10. 1
    1
      openstack_dashboard/dashboards/project/network_topology/instances/tables.py
  11. 4
    4
      openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js
  12. 4
    4
      openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js
  13. 1
    1
      openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js
  14. 1
    1
      openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js
  15. 3
    3
      openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.help.html
  16. 4
    4
      openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.html
  17. 1
    1
      openstack_dashboard/static/dashboard/scss/horizon.scss
  18. 19
    17
      openstack_dashboard/test/integration_tests/pages/project/compute/instancespage.py
  19. 4
    4
      openstack_dashboard/test/integration_tests/tests/test_instances.py
  20. 7
    7
      openstack_dashboard/usage/base.py
  21. 1
    1
      openstack_dashboard/usage/views.py

+ 3
- 3
horizon/static/horizon/js/horizon.instances.js View File

@@ -182,13 +182,13 @@ horizon.addInitFunction(horizon.instances.init = function () {
182 182
         elements_list = "#id_instance_snapshot_id";
183 183
         break;
184 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 186
         break;
187 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 189
         break;
190 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 192
         break;
193 193
     }
194 194
     var elements_list_group = $(elements_list).closest(".form-group");

+ 1
- 1
horizon/static/horizon/js/horizon.networktopology.js View File

@@ -986,7 +986,7 @@ horizon.network_topology = {
986 986
         table2:portTmpl
987 987
       });
988 988
     } else if (d instanceof Server) {
989
-      htmlData.delete_label = gettext('Terminate Instance');
989
+      htmlData.delete_label = gettext('Delete Instance');
990 990
       htmlData.view_details_label = gettext('View Instance Details');
991 991
       htmlData.console_id = d.id;
992 992
       htmlData.ips = d.ip_addresses;

+ 9
- 9
openstack_dashboard/contrib/trove/content/database_clusters/tables.py View File

@@ -29,25 +29,25 @@ from openstack_dashboard.contrib.trove.content.databases import db_capability
29 29
 ACTIVE_STATES = ("ACTIVE",)
30 30
 
31 31
 
32
-class TerminateCluster(tables.BatchAction):
33
-    name = "terminate"
32
+class DeleteCluster(tables.BatchAction):
33
+    name = "delete"
34 34
     icon = "remove"
35 35
     classes = ('btn-danger',)
36
-    help_text = _("Terminated cluster is not recoverable.")
36
+    help_text = _("Deleted cluster is not recoverable.")
37 37
 
38 38
     @staticmethod
39 39
     def action_present(count):
40 40
         return ungettext_lazy(
41
-            u"Terminate Cluster",
42
-            u"Terminate Clusters",
41
+            u"Delete Cluster",
42
+            u"Delete Clusters",
43 43
             count
44 44
         )
45 45
 
46 46
     @staticmethod
47 47
     def action_past(count):
48 48
         return ungettext_lazy(
49
-            u"Scheduled termination of Cluster",
50
-            u"Scheduled termination of Clusters",
49
+            u"Scheduled deletion of Cluster",
50
+            u"Scheduled deletion of Clusters",
51 51
             count
52 52
         )
53 53
 
@@ -159,8 +159,8 @@ class ClustersTable(tables.DataTable):
159 159
         verbose_name = _("Clusters")
160 160
         status_columns = ["task"]
161 161
         row_class = UpdateRow
162
-        table_actions = (LaunchLink, TerminateCluster)
163
-        row_actions = (AddShard, ResetPassword, TerminateCluster)
162
+        table_actions = (LaunchLink, DeleteCluster)
163
+        row_actions = (AddShard, ResetPassword, DeleteCluster)
164 164
 
165 165
 
166 166
 def get_instance_size(instance):

+ 9
- 9
openstack_dashboard/contrib/trove/content/databases/tables.py View File

@@ -31,26 +31,26 @@ from openstack_dashboard.contrib.trove.content.database_backups \
31 31
 ACTIVE_STATES = ("ACTIVE",)
32 32
 
33 33
 
34
-class TerminateInstance(tables.BatchAction):
35
-    help_text = _("Terminated instances are not recoverable.")
34
+class DeleteInstance(tables.BatchAction):
35
+    help_text = _("Deleted instances are not recoverable.")
36 36
 
37 37
     @staticmethod
38 38
     def action_present(count):
39 39
         return ungettext_lazy(
40
-            u"Terminate Instance",
41
-            u"Terminate Instances",
40
+            u"Delete Instance",
41
+            u"Delete Instances",
42 42
             count
43 43
         )
44 44
 
45 45
     @staticmethod
46 46
     def action_past(count):
47 47
         return ungettext_lazy(
48
-            u"Scheduled termination of Instance",
49
-            u"Scheduled termination of Instances",
48
+            u"Scheduled deletion of Instance",
49
+            u"Scheduled deletion of Instances",
50 50
             count
51 51
         )
52 52
 
53
-    name = "terminate"
53
+    name = "delete"
54 54
     classes = ("btn-danger", )
55 55
     icon = "remove"
56 56
 
@@ -340,13 +340,13 @@ class InstancesTable(tables.DataTable):
340 340
         verbose_name = _("Instances")
341 341
         status_columns = ["status"]
342 342
         row_class = UpdateRow
343
-        table_actions = (LaunchLink, TerminateInstance)
343
+        table_actions = (LaunchLink, DeleteInstance)
344 344
         row_actions = (CreateBackup,
345 345
                        ResizeVolume,
346 346
                        ResizeInstance,
347 347
                        RestartInstance,
348 348
                        DetachReplica,
349
-                       TerminateInstance)
349
+                       DeleteInstance)
350 350
 
351 351
 
352 352
 class UsersTable(tables.DataTable):

+ 2
- 2
openstack_dashboard/dashboards/admin/instances/tables.py View File

@@ -171,7 +171,7 @@ class AdminInstancesTable(tables.DataTable):
171 171
         name = "instances"
172 172
         verbose_name = _("Instances")
173 173
         status_columns = ["status", "task"]
174
-        table_actions = (project_tables.TerminateInstance,
174
+        table_actions = (project_tables.DeleteInstance,
175 175
                          AdminInstanceFilterAction)
176 176
         row_class = AdminUpdateRow
177 177
         row_actions = (project_tables.ConfirmResize,
@@ -187,4 +187,4 @@ class AdminInstancesTable(tables.DataTable):
187 187
                        LiveMigrateInstance,
188 188
                        project_tables.SoftRebootInstance,
189 189
                        project_tables.RebootInstance,
190
-                       project_tables.TerminateInstance)
190
+                       project_tables.DeleteInstance)

+ 10
- 10
openstack_dashboard/dashboards/project/instances/tables.py View File

@@ -81,31 +81,31 @@ def is_deleting(instance):
81 81
     return task_state.lower() == "deleting"
82 82
 
83 83
 
84
-class TerminateInstance(policy.PolicyTargetMixin, tables.BatchAction):
85
-    name = "terminate"
84
+class DeleteInstance(policy.PolicyTargetMixin, tables.BatchAction):
85
+    name = "delete"
86 86
     classes = ("btn-danger",)
87 87
     icon = "remove"
88 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 91
     @staticmethod
92 92
     def action_present(count):
93 93
         return ungettext_lazy(
94
-            u"Terminate Instance",
95
-            u"Terminate Instances",
94
+            u"Delete Instance",
95
+            u"Delete Instances",
96 96
             count
97 97
         )
98 98
 
99 99
     @staticmethod
100 100
     def action_past(count):
101 101
         return ungettext_lazy(
102
-            u"Scheduled termination of Instance",
103
-            u"Scheduled termination of Instances",
102
+            u"Scheduled deletion of Instance",
103
+            u"Scheduled deletion of Instances",
104 104
             count
105 105
         )
106 106
 
107 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 109
         return not is_deleting(instance)
110 110
 
111 111
     def action(self, request, obj_id):
@@ -1172,7 +1172,7 @@ class InstancesTable(tables.DataTable):
1172 1172
             launch_actions = (LaunchLink,) + launch_actions
1173 1173
         if getattr(settings, 'LAUNCH_INSTANCE_NG_ENABLED', False):
1174 1174
             launch_actions = (LaunchLinkNG,) + launch_actions
1175
-        table_actions = launch_actions + (TerminateInstance,
1175
+        table_actions = launch_actions + (DeleteInstance,
1176 1176
                                           InstancesFilterAction)
1177 1177
         row_actions = (StartInstance, ConfirmResize, RevertResize,
1178 1178
                        CreateSnapshot, SimpleAssociateIP, AssociateIP,
@@ -1182,4 +1182,4 @@ class InstancesTable(tables.DataTable):
1182 1182
                        ConsoleLink, LogLink, TogglePause, ToggleSuspend,
1183 1183
                        ToggleShelve, ResizeLink, LockInstance, UnlockInstance,
1184 1184
                        SoftRebootInstance, RebootInstance,
1185
-                       StopInstance, RebuildInstance, TerminateInstance)
1185
+                       StopInstance, RebuildInstance, DeleteInstance)

+ 1
- 1
openstack_dashboard/dashboards/project/instances/templates/instances/_instance_flavor.html View File

@@ -10,7 +10,7 @@
10 10
 <script type="text/javascript" charset="utf-8">
11 11
 $(function () {
12 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 14
   if ( $flavor.popover ) {
15 15
     $flavor.popover({html:true});
16 16
   }

+ 6
- 6
openstack_dashboard/dashboards/project/instances/tests.py View File

@@ -242,7 +242,7 @@ class InstanceTests(helpers.TestCase):
242 242
                                       'server_delete',),
243 243
                            api.glance: ('image_list_detailed',),
244 244
                            api.network: ('servers_update_addresses',)})
245
-    def test_terminate_instance(self):
245
+    def test_delete_instance(self):
246 246
         servers = self.servers.list()
247 247
         server = servers[0]
248 248
 
@@ -256,7 +256,7 @@ class InstanceTests(helpers.TestCase):
256 256
         api.nova.server_delete(IsA(http.HttpRequest), server.id)
257 257
         self.mox.ReplayAll()
258 258
 
259
-        formData = {'action': 'instances__terminate__%s' % server.id}
259
+        formData = {'action': 'instances__delete__%s' % server.id}
260 260
         res = self.client.post(INDEX_URL, formData)
261 261
 
262 262
         self.assertRedirectsNoFollow(res, INDEX_URL)
@@ -266,7 +266,7 @@ class InstanceTests(helpers.TestCase):
266 266
                                       'server_delete',),
267 267
                            api.glance: ('image_list_detailed',),
268 268
                            api.network: ('servers_update_addresses',)})
269
-    def test_terminate_instance_exception(self):
269
+    def test_delete_instance_exception(self):
270 270
         servers = self.servers.list()
271 271
         server = servers[0]
272 272
 
@@ -282,7 +282,7 @@ class InstanceTests(helpers.TestCase):
282 282
 
283 283
         self.mox.ReplayAll()
284 284
 
285
-        formData = {'action': 'instances__terminate__%s' % server.id}
285
+        formData = {'action': 'instances__delete__%s' % server.id}
286 286
         res = self.client.post(INDEX_URL, formData)
287 287
 
288 288
         self.assertRedirectsNoFollow(res, INDEX_URL)
@@ -4384,7 +4384,7 @@ class InstanceTests(helpers.TestCase):
4384 4384
                                       'server_delete',),
4385 4385
                            api.glance: ('image_list_detailed',),
4386 4386
                            api.network: ('servers_update_addresses',)})
4387
-    def test_terminate_instance_with_pagination(self):
4387
+    def test_delete_instance_with_pagination(self):
4388 4388
         """Instance should be deleted from
4389 4389
            the next page.
4390 4390
         """
@@ -4408,7 +4408,7 @@ class InstanceTests(helpers.TestCase):
4408 4408
                            servers[page_size - 1].id])
4409 4409
         next_page_url = "?".join([reverse('horizon:project:instances:index'),
4410 4410
                                   params])
4411
-        formData = {'action': 'instances__terminate__%s' % server.id}
4411
+        formData = {'action': 'instances__delete__%s' % server.id}
4412 4412
         res = self.client.post(next_page_url, formData)
4413 4413
 
4414 4414
         self.assertRedirectsNoFollow(res, next_page_url)

+ 13
- 12
openstack_dashboard/dashboards/project/instances/workflows/create_instance.py View File

@@ -128,11 +128,11 @@ class SetInstanceDetailsAction(workflows.Action):
128 128
                                               "system choose a device name "
129 129
                                               "for you."))
130 130
 
131
-    delete_on_terminate = forms.BooleanField(label=_("Delete on Terminate"),
132
-                                             initial=False,
133
-                                             required=False,
134
-                                             help_text=_("Delete volume on "
135
-                                                         "instance terminate"))
131
+    vol_delete_on_instance_delete = forms.BooleanField(
132
+        label=_("Delete Volume on Instance Delete"),
133
+        initial=False,
134
+        required=False,
135
+        help_text=_("Delete volume when the instance is deleted"))
136 136
 
137 137
     class Meta(object):
138 138
         name = _("Details")
@@ -507,7 +507,7 @@ class SetInstanceDetails(workflows.Step):
507 507
     contributes = ("source_type", "source_id",
508 508
                    "availability_zone", "name", "count", "flavor",
509 509
                    "device_name",  # Can be None for an image.
510
-                   "delete_on_terminate")
510
+                   "vol_delete_on_instance_delete")
511 511
 
512 512
     def prepare_action_context(self, request, context):
513 513
         if 'source_type' in context and 'source_id' in context:
@@ -884,17 +884,18 @@ class LaunchInstance(workflows.Workflow):
884 884
                          'source_type': dev_source_type_mapping[source_type],
885 885
                          'destination_type': 'volume',
886 886
                          'delete_on_termination':
887
-                             bool(context['delete_on_terminate']),
887
+                             bool(context['vol_delete_on_instance_delete']),
888 888
                          'uuid': volume_source_id,
889 889
                          'boot_index': '0',
890 890
                          'volume_size': context['volume_size']
891 891
                          }
892 892
                     ]
893 893
                 else:
894
-                    dev_mapping_1 = {context['device_name']: '%s::%s' %
895
-                                     (context['source_id'],
896
-                                     bool(context['delete_on_terminate']))
897
-                                     }
894
+                    dev_mapping_1 = {
895
+                        context['device_name']: '%s::%s' %
896
+                        (context['source_id'],
897
+                         bool(context['vol_delete_on_instance_delete']))
898
+                    }
898 899
             except Exception:
899 900
                 msg = _('Unable to retrieve extensions information')
900 901
                 exceptions.handle(request, msg)
@@ -906,7 +907,7 @@ class LaunchInstance(workflows.Workflow):
906 907
                  'source_type': 'image',
907 908
                  'destination_type': 'volume',
908 909
                  'delete_on_termination':
909
-                     bool(context['delete_on_terminate']),
910
+                     bool(context['vol_delete_on_instance_delete']),
910 911
                  'uuid': context['source_id'],
911 912
                  'boot_index': '0',
912 913
                  'volume_size': context['volume_size']

+ 1
- 1
openstack_dashboard/dashboards/project/network_topology/instances/tables.py View File

@@ -22,5 +22,5 @@ class InstancesTable(tables.InstancesTable):
22 22
         name = "instances"
23 23
         verbose_name = _("Instances")
24 24
         row_actions = (
25
-            tables.TerminateInstance,
25
+            tables.DeleteInstance,
26 26
         )

+ 4
- 4
openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js View File

@@ -160,7 +160,7 @@
160 160
         vol_create: false,
161 161
         // May be null
162 162
         vol_device_name: 'vda',
163
-        vol_delete_on_terminate: false,
163
+        vol_delete_on_instance_delete: false,
164 164
         vol_size: 1
165 165
       };
166 166
     }
@@ -472,7 +472,7 @@
472 472
       delete finalSpec.source_type;
473 473
       delete finalSpec.vol_create;
474 474
       delete finalSpec.vol_device_name;
475
-      delete finalSpec.vol_delete_on_terminate;
475
+      delete finalSpec.vol_delete_on_instance_delete;
476 476
       delete finalSpec.vol_size;
477 477
     }
478 478
 
@@ -486,7 +486,7 @@
486 486
             'device_name': deviceName,
487 487
             'source_type': SOURCE_TYPE_IMAGE,
488 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 490
             'uuid': finalSpec.source_id,
491 491
             'boot_index': '0',
492 492
             'volume_size': finalSpec.vol_size
@@ -503,7 +503,7 @@
503 503
         ':',
504 504
         sourceType,
505 505
         '::',
506
-        finalSpec.vol_delete_on_terminate
506
+        finalSpec.vol_delete_on_instance_delete
507 507
       ].join('');
508 508
 
509 509
       // Source ID must be empty for API

+ 4
- 4
openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js View File

@@ -373,7 +373,7 @@
373 373
         it('sets volume options appropriately', function() {
374 374
           expect(model.newInstanceSpec.vol_create).toBe(false);
375 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 377
           expect(model.newInstanceSpec.vol_size).toBe(1);
378 378
         });
379 379
 
@@ -391,7 +391,7 @@
391 391
           model.newInstanceSpec.security_groups = [ { id: 'adminId', name: 'admin' },
392 392
                                                     { id: 'demoId', name: 'demo' } ];
393 393
           model.newInstanceSpec.vol_create = true;
394
-          model.newInstanceSpec.vol_delete_on_terminate = true;
394
+          model.newInstanceSpec.vol_delete_on_instance_delete = true;
395 395
           model.newInstanceSpec.vol_device_name = "volTestName";
396 396
           model.newInstanceSpec.vol_size = 10;
397 397
         });
@@ -442,7 +442,7 @@
442 442
         it('should handle source type of "volume"', function() {
443 443
           model.newInstanceSpec.source_type.type = 'volume';
444 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 447
           var finalSpec = model.createInstance();
448 448
           expect(finalSpec.block_device_mapping.volTestName)
@@ -461,7 +461,7 @@
461 461
         it('should handle source type of "volume_snapshot"', function() {
462 462
           model.newInstanceSpec.source_type.type = 'volume_snapshot';
463 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 466
           var finalSpec = model.createInstance();
467 467
           expect(finalSpec.block_device_mapping.volTestName)

+ 1
- 1
openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js View File

@@ -240,7 +240,7 @@
240 240
     function updateBootSourceSelection(selectedSource) {
241 241
       ctrl.currentBootSource = selectedSource;
242 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 244
       changeBootSource(selectedSource);
245 245
       validateBootSourceType();
246 246
     }

+ 1
- 1
openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js View File

@@ -137,7 +137,7 @@
137 137
 
138 138
             expect(ctrl.currentBootSource).toEqual('image');
139 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 142
             // check table data
143 143
             expect(ctrl.tableData).toBeDefined();

+ 3
- 3
openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.help.html View File

@@ -6,8 +6,8 @@
6 6
   <p translate><li><b>Image</b>: This option uses an image to boot the instance.</li></p>
7 7
   <p translate><li><b>Instance Snapshot</b>: This option uses an instance snapshot to boot the instance.</li></p>
8 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>
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>
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>
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 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 deletion of the instance.</li></p>
12 12
 
13 13
 </div>

+ 4
- 4
openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.html View File

@@ -77,12 +77,12 @@
77 77
 
78 78
             <div class="col-xs-12 col-sm-4" ng-if="model.newInstanceSpec.vol_create == true">
79 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 81
                 <div class="form-field">
82 82
                   <div class="btn-group">
83 83
                     <label class="btn btn-toggle"
84 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 86
                       btn-radio="option.value">{$ ::option.label $}</label>
87 87
                   </div>
88 88
                 </div>
@@ -96,12 +96,12 @@
96 96
             <div class="col-xs-12 col-sm-6">
97 97
 
98 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 100
                 <div class="form-field">
101 101
                   <div class="btn-group">
102 102
                     <label class="btn btn-toggle"
103 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 105
                       btn-radio="option.value">{$ ::option.label $}</label>
106 106
                   </div>
107 107
                 </div>

+ 1
- 1
openstack_dashboard/static/dashboard/scss/horizon.scss View File

@@ -545,7 +545,7 @@ div.input input[type="checkbox"] {
545 545
   width: 25px;
546 546
 }
547 547
 
548
-tr.terminated {
548
+tr.deleted {
549 549
   color: #999999;
550 550
 }
551 551
 

+ 19
- 17
openstack_dashboard/test/integration_tests/pages/project/compute/instancespage.py View File

@@ -25,13 +25,13 @@ class InstancesPage(basepage.BaseNavigationPage):
25 25
     DEFAULT_VOLUME_NAME = None
26 26
     DEFAULT_SNAPSHOT_NAME = None
27 27
     DEFAULT_VOLUME_SNAPSHOT_NAME = None
28
-    DEFAULT_DELETE_ON_TERMINATE = False
28
+    DEFAULT_VOL_DELETE_ON_INSTANCE_DELETE = False
29 29
     DEFAULT_SECURITY_GROUP = True
30 30
 
31 31
     _instances_table_locator = (by.By.CSS_SELECTOR, 'table#instances')
32 32
 
33 33
     INSTANCES_TABLE_NAME = "instances"
34
-    INSTANCES_TABLE_ACTIONS = ("launch_ng", "launch", "terminate",
34
+    INSTANCES_TABLE_ACTIONS = ("launch_ng", "launch", "delete",
35 35
                                ('start', 'stop', "reboot"))
36 36
     INSTANCES_TABLE_NAME_COLUMN_INDEX = 0
37 37
     INSTANCES_TABLE_STATUS_COLUMN_INDEX = 5
@@ -41,14 +41,14 @@ class InstancesPage(basepage.BaseNavigationPage):
41 41
             "associate_floating_ip", "disassociate_floating_ip",
42 42
             "edit_instance", "edit_security_groups", "console",
43 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 47
     CREATE_INSTANCE_FORM_FIELDS = ((
48 48
         "availability_zone", "name", "flavor",
49 49
         "count", "source_type", "instance_snapshot_id",
50 50
         "volume_id", "volume_snapshot_id", "image_id", "volume_size",
51
-        "delete_on_terminate"),
51
+        "vol_delete_on_instance_delete"),
52 52
         ("keypair", "groups"),
53 53
         ("script_source", "script_upload", "script_data"),
54 54
         ("disk_config", "config_drive")
@@ -88,14 +88,16 @@ class InstancesPage(basepage.BaseNavigationPage):
88 88
     def is_instance_present(self, name):
89 89
         return bool(self._get_row_with_instance_name(name))
90 90
 
91
-    def create_instance(self, instance_name,
92
-                        available_zone=None,
93
-                        instance_count=DEFAULT_COUNT,
94
-                        flavor=DEFAULT_FLAVOR,
95
-                        boot_source=DEFAULT_BOOT_SOURCE,
96
-                        source_name=None,
97
-                        device_size=None,
98
-                        delete_on_terminate=DEFAULT_DELETE_ON_TERMINATE):
91
+    def create_instance(
92
+            self, instance_name,
93
+            available_zone=None,
94
+            instance_count=DEFAULT_COUNT,
95
+            flavor=DEFAULT_FLAVOR,
96
+            boot_source=DEFAULT_BOOT_SOURCE,
97
+            source_name=None,
98
+            device_size=None,
99
+            vol_delete_on_instance_delete=DEFAULT_VOL_DELETE_ON_INSTANCE_DELETE
100
+    ):
99 101
         if not available_zone:
100 102
             available_zone = self.conf.launch_instances.available_zone
101 103
         self.instances_table.launch.click()
@@ -112,19 +114,19 @@ class InstancesPage(basepage.BaseNavigationPage):
112 114
         boot_source[0].text = source_name
113 115
         if device_size:
114 116
             instance.volume_size.value = device_size
115
-        if delete_on_terminate:
116
-            instance.delete_on_terminate.mark()
117
+        if vol_delete_on_instance_delete:
118
+            instance.vol_delete_on_instance_delete.mark()
117 119
         instance.submit.click()
118 120
         self.wait_till_popups_disappear()
119 121
 
120
-    def terminate_instance(self, name):
122
+    def delete_instance(self, name):
121 123
         row = self._get_row_with_instance_name(name)
122 124
         row.mark()
123
-        self.instances_table.terminate.click()
125
+        self.instances_table.delete.click()
124 126
         self.confirm_delete_instances_form.submit.click()
125 127
         self.wait_till_popups_disappear()
126 128
 
127
-    def is_instance_terminated(self, name):
129
+    def is_instance_deleted(self, name):
128 130
         try:
129 131
             row = self._get_row_with_instance_name(name)
130 132
             self._wait_till_element_disappears(row)

+ 4
- 4
openstack_dashboard/test/integration_tests/tests/test_instances.py View File

@@ -17,12 +17,12 @@ INSTANCES_NAME = helpers.gen_random_resource_name('instance',
17 17
 
18 18
 class TestInstances(helpers.AdminTestCase):
19 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 24
         instances_page = self.home_pg.go_to_compute_instancespage()
25 25
         instances_page.create_instance(INSTANCES_NAME)
26 26
         self.assertTrue(instances_page.is_instance_active(INSTANCES_NAME))
27
-        instances_page.terminate_instance(INSTANCES_NAME)
28
-        self.assertTrue(instances_page.is_instance_terminated(INSTANCES_NAME))
27
+        instances_page.delete_instance(INSTANCES_NAME)
28
+        self.assertTrue(instances_page.is_instance_deleted(INSTANCES_NAME))

+ 7
- 7
openstack_dashboard/usage/base.py View File

@@ -26,7 +26,7 @@ from openstack_dashboard.usage import quotas
26 26
 
27 27
 
28 28
 class BaseUsage(object):
29
-    show_terminated = False
29
+    show_deleted = False
30 30
 
31 31
     def __init__(self, request, project_id=None):
32 32
         self.project_id = project_id or request.user.tenant_id
@@ -248,7 +248,7 @@ class BaseUsage(object):
248 248
 
249 249
 
250 250
 class GlobalUsage(BaseUsage):
251
-    show_terminated = True
251
+    show_deleted = True
252 252
 
253 253
     def get_usage_list(self, start, end):
254 254
         return api.nova.usage_list(self.request, start, end)
@@ -259,10 +259,10 @@ class ProjectUsage(BaseUsage):
259 259
              'hours', 'local_gb')
260 260
 
261 261
     def get_usage_list(self, start, end):
262
-        show_terminated = self.request.GET.get('show_terminated',
263
-                                               self.show_terminated)
262
+        show_deleted = self.request.GET.get('show_deleted',
263
+                                            self.show_deleted)
264 264
         instances = []
265
-        terminated_instances = []
265
+        deleted_instances = []
266 266
         usage = api.nova.usage_get(self.request, self.project_id, start, end)
267 267
         # Attribute may not exist if there are no instances
268 268
         if hasattr(usage, 'server_usages'):
@@ -273,8 +273,8 @@ class ProjectUsage(BaseUsage):
273 273
                 server_uptime = server_usage['uptime']
274 274
                 total_uptime = now - datetime.timedelta(seconds=server_uptime)
275 275
                 server_usage['uptime_at'] = total_uptime
276
-                if server_usage['ended_at'] and not show_terminated:
277
-                    terminated_instances.append(server_usage)
276
+                if server_usage['ended_at'] and not show_deleted:
277
+                    deleted_instances.append(server_usage)
278 278
                 else:
279 279
                     instances.append(server_usage)
280 280
         usage.server_usages = instances

+ 1
- 1
openstack_dashboard/usage/views.py View File

@@ -20,7 +20,7 @@ from openstack_dashboard.usage import base
20 20
 
21 21
 class UsageView(tables.DataTableView):
22 22
     usage_class = None
23
-    show_terminated = True
23
+    show_deleted = True
24 24
     csv_template_name = None
25 25
     page_title = _("Overview")
26 26
 

Loading…
Cancel
Save