summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriswarya_vakati <v.iswarya@nectechnologies.in>2017-07-05 16:01:35 +0530
committeriswarya_vakati <v.iswarya@nectechnologies.in>2017-07-05 16:01:54 +0530
commita42bb36d5f6f12d2470f6072feaa3a47da0e5463 (patch)
tree9cdb838ebad29d5814718df9cbbf0f6dd4a97c9a
parente0b55c296d1373a01674c0bfee2cac848ad7b911 (diff)
Replaces uuid.uuid4 with uuidutils.generate_uuid()
Notes
Notes (review): Code-Review+1: M V P Nitesh <m.nitesh@nectechnologies.in> Code-Review+1: Cuong Nguyen <cuongnv@vn.fujitsu.com> Code-Review+2: Yuval Brik <yuval@brik.org.il> Workflow+1: Yuval Brik <yuval@brik.org.il> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Sun, 23 Jul 2017 06:39:13 +0000 Reviewed-on: https://review.openstack.org/480507 Project: openstack/karbor-dashboard Branch: refs/heads/master
-rw-r--r--karbor_dashboard/checkpoints/views.py6
-rw-r--r--karbor_dashboard/protectionplans/views.py10
2 files changed, 8 insertions, 8 deletions
diff --git a/karbor_dashboard/checkpoints/views.py b/karbor_dashboard/checkpoints/views.py
index 133af62..9315d39 100644
--- a/karbor_dashboard/checkpoints/views.py
+++ b/karbor_dashboard/checkpoints/views.py
@@ -12,7 +12,6 @@
12# License for the specific language governing permissions and limitations 12# License for the specific language governing permissions and limitations
13# under the License. 13# under the License.
14 14
15import uuid
16 15
17from django.core.urlresolvers import reverse 16from django.core.urlresolvers import reverse
18from django.core.urlresolvers import reverse_lazy 17from django.core.urlresolvers import reverse_lazy
@@ -31,6 +30,7 @@ from karbor_dashboard.checkpoints import forms
31from karbor_dashboard.checkpoints import tables 30from karbor_dashboard.checkpoints import tables
32from karbor_dashboard.checkpoints import utils 31from karbor_dashboard.checkpoints import utils
33from karborclient.v1 import protectables 32from karborclient.v1 import protectables
33from oslo_utils import uuidutils
34 34
35 35
36class IndexView(horizon_tables.DataTableView): 36class IndexView(horizon_tables.DataTableView):
@@ -232,7 +232,7 @@ class CheckpointsRestoreView(horizon_forms.ModalFormView):
232 resource["id"] = graphnode.value.id 232 resource["id"] = graphnode.value.id
233 resource["type"] = graphnode.value.type 233 resource["type"] = graphnode.value.type
234 resource["name"] = graphnode.value.name 234 resource["name"] = graphnode.value.name
235 resource["showid"] = str(uuid.uuid4()) 235 resource["showid"] = uuidutils.generate_uuid()
236 resource["showparentid"] = showparentid 236 resource["showparentid"] = showparentid
237 result = protectables.Instances(self, resource) 237 result = protectables.Instances(self, resource)
238 results.append(result) 238 results.append(result)
@@ -300,7 +300,7 @@ class DetailView(horizon_tables.DataTableView):
300 resource["id"] = graphnode.value.id 300 resource["id"] = graphnode.value.id
301 resource["type"] = graphnode.value.type 301 resource["type"] = graphnode.value.type
302 resource["name"] = graphnode.value.name 302 resource["name"] = graphnode.value.name
303 resource["showid"] = str(uuid.uuid4()) 303 resource["showid"] = uuidutils.generate_uuid()
304 resource["showparentid"] = showparentid 304 resource["showparentid"] = showparentid
305 result = protectables.Instances(self, resource) 305 result = protectables.Instances(self, resource)
306 results.append(result) 306 results.append(result)
diff --git a/karbor_dashboard/protectionplans/views.py b/karbor_dashboard/protectionplans/views.py
index 554428d..6b898cb 100644
--- a/karbor_dashboard/protectionplans/views.py
+++ b/karbor_dashboard/protectionplans/views.py
@@ -13,7 +13,6 @@
13# under the License. 13# under the License.
14 14
15import json 15import json
16import uuid
17 16
18from django.core.urlresolvers import reverse 17from django.core.urlresolvers import reverse
19from django.core.urlresolvers import reverse_lazy 18from django.core.urlresolvers import reverse_lazy
@@ -29,6 +28,7 @@ from karbor_dashboard.api import karbor as karborclient
29from karbor_dashboard.protectionplans import forms 28from karbor_dashboard.protectionplans import forms
30from karbor_dashboard.protectionplans import tables 29from karbor_dashboard.protectionplans import tables
31from karborclient.v1 import protectables 30from karborclient.v1 import protectables
31from oslo_utils import uuidutils
32 32
33 33
34class IndexView(horizon_tables.DataTableView): 34class IndexView(horizon_tables.DataTableView):
@@ -122,7 +122,7 @@ class CreateView(horizon_forms.ModalFormView):
122 resource["id"] = instance.id 122 resource["id"] = instance.id
123 resource["type"] = instance.type 123 resource["type"] = instance.type
124 resource["name"] = instance.name 124 resource["name"] = instance.name
125 resource["showid"] = str(uuid.uuid4()) 125 resource["showid"] = uuidutils.generate_uuid()
126 resource["showparentid"] = showparentid 126 resource["showparentid"] = showparentid
127 result = protectables.Instances(self, resource) 127 result = protectables.Instances(self, resource)
128 results.append(result) 128 results.append(result)
@@ -174,7 +174,7 @@ class UpdateView(horizon_forms.ModalFormView):
174 resource["id"] = instance.id 174 resource["id"] = instance.id
175 resource["type"] = instance.type 175 resource["type"] = instance.type
176 resource["name"] = instance.name 176 resource["name"] = instance.name
177 resource["showid"] = str(uuid.uuid4()) 177 resource["showid"] = uuidutils.generate_uuid()
178 resource["showparentid"] = showparentid 178 resource["showparentid"] = showparentid
179 result = protectables.Instances(self, resource) 179 result = protectables.Instances(self, resource)
180 results.append(result) 180 results.append(result)
@@ -294,7 +294,7 @@ class DetailView(horizon_views.HorizonTemplateView):
294 try: 294 try:
295 result = [] 295 result = []
296 for instance in instances: 296 for instance in instances:
297 instance["showid"] = str(uuid.uuid4()) 297 instance["showid"] = uuidutils.generate_uuid()
298 result.append(protectables.Instances(self, instance)) 298 result.append(protectables.Instances(self, instance))
299 detail_instance = karborclient.protectable_get_instance( 299 detail_instance = karborclient.protectable_get_instance(
300 self.request, 300 self.request,
@@ -302,7 +302,7 @@ class DetailView(horizon_views.HorizonTemplateView):
302 instance["id"].strip()) 302 instance["id"].strip())
303 if detail_instance.dependent_resources: 303 if detail_instance.dependent_resources:
304 for dependent in detail_instance.dependent_resources: 304 for dependent in detail_instance.dependent_resources:
305 dependent["showid"] = str(uuid.uuid4()) 305 dependent["showid"] = uuidutils.generate_uuid()
306 dependent["showparentid"] = instance["showid"] 306 dependent["showparentid"] = instance["showid"]
307 result.append( 307 result.append(
308 protectables.Instances(self, dependent)) 308 protectables.Instances(self, dependent))