Skip to content

Commit

Permalink
NatServices: show state, net_id, subnet_id
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 26, 2023
1 parent 1a18501 commit a83b75f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions osc_tui/natServices.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
class natServicesGrid(selectableGrid.SelectableGrid):
def __init__(self, screen, *args, **keywords):
super().__init__(screen, *args, **keywords)
self.col_titles = ["Id"]
self.col_titles = ["Id", "State", "NetId", "SubnetId"]

def refresh_call(self, name_filter=None):
groups = main.GATEWAY.ReadNatServices(form=self.form)['NatServices']
return groups

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

0 comments on commit a83b75f

Please sign in to comment.