Replaces uuid.uuid4 with uuidutils.generate_uuid()
Change-Id: I751aa0e819faaf0a5cd07741fa812ab15dec967d
This commit is contained in:
parent
e0b55c296d
commit
a42bb36d5f
|
@ -12,7 +12,6 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import uuid
|
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.core.urlresolvers import reverse_lazy
|
from django.core.urlresolvers import reverse_lazy
|
||||||
|
@ -31,6 +30,7 @@ from karbor_dashboard.checkpoints import forms
|
||||||
from karbor_dashboard.checkpoints import tables
|
from karbor_dashboard.checkpoints import tables
|
||||||
from karbor_dashboard.checkpoints import utils
|
from karbor_dashboard.checkpoints import utils
|
||||||
from karborclient.v1 import protectables
|
from karborclient.v1 import protectables
|
||||||
|
from oslo_utils import uuidutils
|
||||||
|
|
||||||
|
|
||||||
class IndexView(horizon_tables.DataTableView):
|
class IndexView(horizon_tables.DataTableView):
|
||||||
|
@ -232,7 +232,7 @@ class CheckpointsRestoreView(horizon_forms.ModalFormView):
|
||||||
resource["id"] = graphnode.value.id
|
resource["id"] = graphnode.value.id
|
||||||
resource["type"] = graphnode.value.type
|
resource["type"] = graphnode.value.type
|
||||||
resource["name"] = graphnode.value.name
|
resource["name"] = graphnode.value.name
|
||||||
resource["showid"] = str(uuid.uuid4())
|
resource["showid"] = uuidutils.generate_uuid()
|
||||||
resource["showparentid"] = showparentid
|
resource["showparentid"] = showparentid
|
||||||
result = protectables.Instances(self, resource)
|
result = protectables.Instances(self, resource)
|
||||||
results.append(result)
|
results.append(result)
|
||||||
|
@ -300,7 +300,7 @@ class DetailView(horizon_tables.DataTableView):
|
||||||
resource["id"] = graphnode.value.id
|
resource["id"] = graphnode.value.id
|
||||||
resource["type"] = graphnode.value.type
|
resource["type"] = graphnode.value.type
|
||||||
resource["name"] = graphnode.value.name
|
resource["name"] = graphnode.value.name
|
||||||
resource["showid"] = str(uuid.uuid4())
|
resource["showid"] = uuidutils.generate_uuid()
|
||||||
resource["showparentid"] = showparentid
|
resource["showparentid"] = showparentid
|
||||||
result = protectables.Instances(self, resource)
|
result = protectables.Instances(self, resource)
|
||||||
results.append(result)
|
results.append(result)
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import uuid
|
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.core.urlresolvers import reverse_lazy
|
from django.core.urlresolvers import reverse_lazy
|
||||||
|
@ -29,6 +28,7 @@ from karbor_dashboard.api import karbor as karborclient
|
||||||
from karbor_dashboard.protectionplans import forms
|
from karbor_dashboard.protectionplans import forms
|
||||||
from karbor_dashboard.protectionplans import tables
|
from karbor_dashboard.protectionplans import tables
|
||||||
from karborclient.v1 import protectables
|
from karborclient.v1 import protectables
|
||||||
|
from oslo_utils import uuidutils
|
||||||
|
|
||||||
|
|
||||||
class IndexView(horizon_tables.DataTableView):
|
class IndexView(horizon_tables.DataTableView):
|
||||||
|
@ -122,7 +122,7 @@ class CreateView(horizon_forms.ModalFormView):
|
||||||
resource["id"] = instance.id
|
resource["id"] = instance.id
|
||||||
resource["type"] = instance.type
|
resource["type"] = instance.type
|
||||||
resource["name"] = instance.name
|
resource["name"] = instance.name
|
||||||
resource["showid"] = str(uuid.uuid4())
|
resource["showid"] = uuidutils.generate_uuid()
|
||||||
resource["showparentid"] = showparentid
|
resource["showparentid"] = showparentid
|
||||||
result = protectables.Instances(self, resource)
|
result = protectables.Instances(self, resource)
|
||||||
results.append(result)
|
results.append(result)
|
||||||
|
@ -174,7 +174,7 @@ class UpdateView(horizon_forms.ModalFormView):
|
||||||
resource["id"] = instance.id
|
resource["id"] = instance.id
|
||||||
resource["type"] = instance.type
|
resource["type"] = instance.type
|
||||||
resource["name"] = instance.name
|
resource["name"] = instance.name
|
||||||
resource["showid"] = str(uuid.uuid4())
|
resource["showid"] = uuidutils.generate_uuid()
|
||||||
resource["showparentid"] = showparentid
|
resource["showparentid"] = showparentid
|
||||||
result = protectables.Instances(self, resource)
|
result = protectables.Instances(self, resource)
|
||||||
results.append(result)
|
results.append(result)
|
||||||
|
@ -294,7 +294,7 @@ class DetailView(horizon_views.HorizonTemplateView):
|
||||||
try:
|
try:
|
||||||
result = []
|
result = []
|
||||||
for instance in instances:
|
for instance in instances:
|
||||||
instance["showid"] = str(uuid.uuid4())
|
instance["showid"] = uuidutils.generate_uuid()
|
||||||
result.append(protectables.Instances(self, instance))
|
result.append(protectables.Instances(self, instance))
|
||||||
detail_instance = karborclient.protectable_get_instance(
|
detail_instance = karborclient.protectable_get_instance(
|
||||||
self.request,
|
self.request,
|
||||||
|
@ -302,7 +302,7 @@ class DetailView(horizon_views.HorizonTemplateView):
|
||||||
instance["id"].strip())
|
instance["id"].strip())
|
||||||
if detail_instance.dependent_resources:
|
if detail_instance.dependent_resources:
|
||||||
for dependent in detail_instance.dependent_resources:
|
for dependent in detail_instance.dependent_resources:
|
||||||
dependent["showid"] = str(uuid.uuid4())
|
dependent["showid"] = uuidutils.generate_uuid()
|
||||||
dependent["showparentid"] = instance["showid"]
|
dependent["showparentid"] = instance["showid"]
|
||||||
result.append(
|
result.append(
|
||||||
protectables.Instances(self, dependent))
|
protectables.Instances(self, dependent))
|
||||||
|
|
Loading…
Reference in New Issue