From f07dca96e44bb9fb9360dfc7aed16f13ece49037 Mon Sep 17 00:00:00 2001 From: caoyuan Date: Tue, 6 Mar 2018 11:54:32 +0800 Subject: [PATCH] Update uuid.uuid4() to uuidutils.generate_uuid() Since oslo.utils provide the ability to generate the uuid string, and some others use oslo.utils[0] too. For consistency, this ps replaces uuid.uuid4() with uuidutils.generate_uuid(). missing from Ide5cdaf48a27e9c080fd8691b100a601f82ca2bf Change-Id: Ia9b8cda25252b70d3706c23e402ae81ccf48e33e --- freezer/openstack/backup.py | 2 +- freezer/tests/integration/test_rsync_backup.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/freezer/openstack/backup.py b/freezer/openstack/backup.py index 9683f49a..3f39b884 100644 --- a/freezer/openstack/backup.py +++ b/freezer/openstack/backup.py @@ -97,7 +97,7 @@ class BackupOs(object): backups = cinder.backups.list(search_opts=search_opts) if len(backups) <= 0: msg = ("Backup volume %s is failed." - "Do a full backup before incremental backup" + "Do a full backup before incremental backup" % volume_id) raise Exception(msg) else: diff --git a/freezer/tests/integration/test_rsync_backup.py b/freezer/tests/integration/test_rsync_backup.py index 9a352713..91e6cf01 100644 --- a/freezer/tests/integration/test_rsync_backup.py +++ b/freezer/tests/integration/test_rsync_backup.py @@ -15,9 +15,9 @@ from copy import copy import os -import uuid from freezer.tests.integration import common +from oslo_utils import uuidutils class TestBackupFSLocalRsync(common.TestFS): @@ -47,7 +47,7 @@ class TestBackupFSLocalRsync(common.TestFS): 'storage': 'local', 'engine': 'rsync', 'max_segment_size': '67108864', - 'backup_name': uuid.uuid4().hex + 'backup_name': uuidutils.generate_uuid(dashed=False) } restore_args = { @@ -84,7 +84,7 @@ class TestBackupFSLocalRsync(common.TestFS): """ self.source_tree.add_random_data() self.assertTreesMatchNot() - backup_name = uuid.uuid4().hex + backup_name = uuidutils.generate_uuid(dashed=False) with common.Temp_Tree() as storage_dir: backup_args = { @@ -144,7 +144,7 @@ class TestBackupFSLocalRsync(common.TestFS): 'storage': 'local', 'engine': 'rsync', 'max_segment_size': '67108864', - 'backup_name': uuid.uuid4().hex + 'backup_name': uuidutils.generate_uuid(dashed=False) } restore_args = {