summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-07-23 06:39:13 +0000
committerGerrit Code Review <review@openstack.org>2017-07-23 06:39:13 +0000
commit9a0312fc1a376b504b67478142dde66b142aa42e (patch)
tree47c88d6acca1c9542e2904cc071f23cb274e913a
parent62e2b2d80e62831680e9e267294b7fda6fb7bde4 (diff)
parenta42bb36d5f6f12d2470f6072feaa3a47da0e5463 (diff)
Merge "Replaces uuid.uuid4 with uuidutils.generate_uuid()"
-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))