STX-O Volume Backup support with Openstack Plugin and SDK
This change adds a default value for the location parameter in the openstack client. It also keeps compatibility with the new property param. Test Plan: [PASS] build stx-openstack packages and tarball [PASS] build image and override a deploy [PASS] test volume backup command without the location param [PASS] test volume backup command with a property param [PASS] test location param not being override by default param. [PASS] launch a VM using the volume. story: 2011553 task: 52903 Change-Id: I13e33cf94551f5f1126aee4b7e2887243020aeae Signed-off-by: Johnny Chia <johnny.chialung@windriver.com>
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
From bc1af8fc831eeaf32c51197e3603c89b08caf97e Mon Sep 17 00:00:00 2001
|
||||
From: jchialun <johnny.chialung@windriver.com>
|
||||
Date: Fri, 10 Oct 2025 12:18:54 -0500
|
||||
Subject: [PATCH 1/1] Volume backup support with Openstack plugging and SDK
|
||||
|
||||
Add openstack plugin support to communicate with STX-O and Openstack
|
||||
vanilla by adding a default value to the location parameter. It is
|
||||
required to keep compatibility with vanilla versions.
|
||||
|
||||
Signed-off-by: Johnny Chia <johnny.chialung@windriver.com>
|
||||
---
|
||||
openstackclient/volume/v2/volume_backup.py | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/openstackclient/volume/v2/volume_backup.py b/openstackclient/volume/v2/volume_backup.py
|
||||
index decb5beb..bf8646ea 100644
|
||||
--- a/openstackclient/volume/v2/volume_backup.py
|
||||
+++ b/openstackclient/volume/v2/volume_backup.py
|
||||
@@ -158,9 +158,13 @@ class CreateVolumeBackup(command.ShowOne):
|
||||
|
||||
kwargs['metadata'] = parsed_args.properties
|
||||
|
||||
- if not parsed_args.location and parsed_args.properties:
|
||||
- parsed_args.location = parsed_args.properties.get("location", None)
|
||||
- elif sdk_utils.supports_microversion(volume_client, '3.43'):
|
||||
+ if not parsed_args.location:
|
||||
+ if parsed_args.properties:
|
||||
+ parsed_args.location = parsed_args.properties.get("location", "ceph")
|
||||
+ else:
|
||||
+ parsed_args.location = "ceph"
|
||||
+
|
||||
+ if sdk_utils.supports_microversion(volume_client, '3.43'):
|
||||
if kwargs.get('metadata', None):
|
||||
kwargs['metadata']['location'] = parsed_args.location
|
||||
else:
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
0002-Add-location-parameter-for-volume-backup-creation.patch
|
||||
0003-Support-location-metadata-for-volume-backups.patch
|
||||
0004-Fix-Volume-backup-restore-output.patch
|
||||
0005-Volume-backup-support-with-Openstack-plugin.patch
|
||||
|
||||
Reference in New Issue
Block a user