Skip to content

Commit 98b9496

Browse files
committed
Add is_incremental to ListVolumeBackup
It's of interest which backups are incremental or full. Returning this information as a column to the list of backups. Change-Id: I766330228634d5db678df11c23877077a3635372
1 parent 619925e commit 98b9496

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ def create_one_backup(attrs=None):
520520
"object_count": None,
521521
"container": 'container-' + uuid.uuid4().hex,
522522
"size": random.randint(1, 20),
523+
"is_incremental": False,
523524
"status": "error",
524525
"availability_zone": 'zone' + uuid.uuid4().hex,
525526
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ class TestBackupList(TestBackup):
356356
'Description',
357357
'Status',
358358
'Size',
359+
'Incremental',
359360
)
360361
columns_long = columns + (
361362
'Availability Zone',
@@ -372,6 +373,7 @@ class TestBackupList(TestBackup):
372373
b.description,
373374
b.status,
374375
b.size,
376+
b.is_incremental,
375377
)
376378
)
377379
data_long = []
@@ -383,6 +385,7 @@ class TestBackupList(TestBackup):
383385
b.description,
384386
b.status,
385387
b.size,
388+
b.is_incremental,
386389
b.availability_zone,
387390
volume_backup.VolumeIdColumn(b.volume_id),
388391
b.container,

openstackclient/volume/v2/volume_backup.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,22 @@ def get_parser(self, prog_name):
309309
def take_action(self, parsed_args):
310310
volume_client = self.app.client_manager.sdk_connection.volume
311311

312-
columns = ('id', 'name', 'description', 'status', 'size')
313-
column_headers = ('ID', 'Name', 'Description', 'Status', 'Size')
312+
columns = (
313+
'id',
314+
'name',
315+
'description',
316+
'status',
317+
'size',
318+
'is_incremental',
319+
)
320+
column_headers = (
321+
'ID',
322+
'Name',
323+
'Description',
324+
'Status',
325+
'Size',
326+
'Incremental',
327+
)
314328
if parsed_args.long:
315329
columns += ('availability_zone', 'volume_id', 'container')
316330
column_headers += ('Availability Zone', 'Volume', 'Container')

0 commit comments

Comments
 (0)