Skip to content

Commit

Permalink
volumes: add more options
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Gatto <[email protected]>
  • Loading branch information
outscale-mgo committed Dec 12, 2022
1 parent 412869a commit 3f57555
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions osc_tui/volumesGrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class VolumeEdit(oscscreen.FormBaseNew):
def __init__(self, *args, **keywords):
self.volume = keywords["volume"]
self.size = self.volume[2]
self.type = self.volume[1]
super().__init__(*args, **keywords)

def reload(self):
Expand All @@ -67,6 +68,7 @@ def back(self):
def update(self):
id=self.volume[0]
main.GATEWAY.UpdateVolume(VolumeId=id,
VolumeType=self.type_wid.get_values()[self.type_wid.get_value()],
Size=int(self.size_wid.get_value()))
self.back()

Expand All @@ -79,6 +81,22 @@ def create(self):
value=str(self.size)
)

tval = None
i = 0
type_values = ['standard', 'gp2', 'io1']
for t in type_values:
if t == self.type:
tval = i
i += 1

self.type_wid = self.add_widget(
oscscreen.TitleCombo,
relx=self.LIST_THRESHOLD,
name="type",
value=tval,
values=type_values
)

self.add_widget(oscscreen.ButtonPress,
name="UPDATE").whenPressed = self.update
self.add_widget(oscscreen.ButtonPress,
Expand Down

0 comments on commit 3f57555

Please sign in to comment.