Skip to content

Commit 94caaa4

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Migrate backup commands to SDK"
2 parents c7c79c9 + bfd6170 commit 94caaa4

File tree

4 files changed

+227
-146
lines changed

4 files changed

+227
-146
lines changed

openstackclient/tests/unit/volume/v2/fakes.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import uuid
1919

2020
from cinderclient import api_versions
21+
from openstack.block_storage.v3 import backup as _backup
2122
from openstack.block_storage.v3 import volume
2223
from osc_lib.cli import format_columns
2324

@@ -543,7 +544,17 @@ def create_one_backup(attrs=None):
543544

544545
# Set default attributes.
545546
backup_info = {
547+
"created_at": 'time-' + uuid.uuid4().hex,
548+
"data_timestamp": 'time-' + uuid.uuid4().hex,
546549
"id": 'backup-id-' + uuid.uuid4().hex,
550+
"encryption_key_id": None,
551+
"fail_reason": "Service not found for creating backup.",
552+
"has_dependent_backups": False,
553+
"is_incremental": False,
554+
"metadata": {},
555+
"project_id": uuid.uuid4().hex,
556+
"updated_at": 'time-' + uuid.uuid4().hex,
557+
"user_id": uuid.uuid4().hex,
547558
"name": 'backup-name-' + uuid.uuid4().hex,
548559
"volume_id": 'volume-id-' + uuid.uuid4().hex,
549560
"snapshot_id": 'snapshot-id' + uuid.uuid4().hex,
@@ -558,7 +569,7 @@ def create_one_backup(attrs=None):
558569
# Overwrite default attributes.
559570
backup_info.update(attrs)
560571

561-
backup = fakes.FakeResource(info=copy.deepcopy(backup_info), loaded=True)
572+
backup = _backup.Backup(**backup_info)
562573
return backup
563574

564575

0 commit comments

Comments
 (0)