Skip to content

Commit

Permalink
subnets: add delete, and show 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 29, 2023
1 parent b443424 commit c360a0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions osc_tui/popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ def associateRoutetable():
exit()

def delete_cb():
main.GATEWAY.DeleteSubnet(SubnetId=name)
form.current_grid.h_refresh(None)
exit()
delete.whenPressed = delete_cb
Expand Down
6 changes: 3 additions & 3 deletions osc_tui/vpcsGrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def refresh(self):
class subnetGrid(selectableGrid.SelectableGrid):
def __init__(self, screen, *args, **keywords):
super().__init__(screen, *args, **keywords)
self.col_titles = ["ID", "CIDR", "NET ID"]
self.col_titles = ["ID", "CIDR", "Net ID", "State"]

def on_selection(line):
popup.editSubnet(self.form, line)
Expand All @@ -43,9 +43,9 @@ def refresh_call(self, name_filter=None):
return groups

def refresh(self):
groups = main.do_search(self.data.copy(), ["SubnetId", "IpRange", "NetId"])
groups = main.do_search(self.data.copy(), ["SubnetId", "IpRange", "NetId", "State"])
values = list()
for g in groups:
values.append([g['SubnetId'],
g['IpRange'], g['NetId']])
g['IpRange'], g['NetId'], g['State']])
self.values = values

0 comments on commit c360a0a

Please sign in to comment.