Skip to content

Commit

Permalink
Nics: more infos
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 15, 2023
1 parent 06cc791 commit e9adb8e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions osc_tui/nicsGrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@
class nicsGrid(selectableGrid.SelectableGrid):
def __init__(self, screen, *args, **keywords):
super().__init__(screen, *args, **keywords)
self.col_titles = ["Id", "State"]
self.col_titles = ["Id", "State", "SubnetId", "NetId", "Description", "MacAddress"]

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

def refresh(self):
groups = main.do_search(self.data.copy(), ["NicId", "State"])
nics = main.do_search(self.data.copy(), ["NicId", "State", "SubnetId", "NetId", "Description", "MacAddress"])
values = list()
for g in groups:
values.append([g['NicId'], g["State"]])
for n in nics:
subnet_id = n["SubnetId"] if "SubnetId" in n else "Unlinked"
net_id = n["NetId"] if "NetId" in n else "Unlinked"
description = n["Description"] if "Description" in n else "???"
mac_address = n["MacAddress"] if "MacAddress" in n else "???"

values.append([n['NicId'], n["State"]], subnet_id, net_id, description, mac_address)
self.values = values

0 comments on commit e9adb8e

Please sign in to comment.