Skip to content

Commit

Permalink
Volumes: add State
Browse files Browse the repository at this point in the history
Signed-off-by: matthias.gatto <[email protected]>
  • Loading branch information
outscale-mgo committed Sep 26, 2023
1 parent d92b64c commit 137fa6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions osc_tui/volumesGrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def __init__(self, screen, *args, **keywords):
self.col_titles = [
"Id",
"Type",
"State",
'Size (Gb)',
'Subregion',
'Linked To',
Expand All @@ -28,14 +29,14 @@ def refresh_call(self, name_filter=None):
return groups['Volumes']

def refresh(self):
groups = main.do_search(self.data.copy(), ['VolumeId', 'VolumeType',
groups = main.do_search(self.data.copy(), ['VolumeId', 'VolumeType', 'State'
'Size', 'SubregionName', 'Iops'])
values = list()
for g in groups:
VolLink = g["LinkedVolumes"]
VmId = VolLink[0]["VmId"] if VolLink else "Unlinked"
DName = VolLink[0]["DeviceName"] if VolLink else "No Dev Today"
values.append([g["VolumeId"], g["VolumeType"],
values.append([g["VolumeId"], g["VolumeType"], g["State"],
g["Size"], g['SubregionName'], VmId, DName, g['Iops'] if 'Iops' in g else '??'])
self.values = values

Expand Down

0 comments on commit 137fa6e

Please sign in to comment.