Skip to content

Commit

Permalink
with the file, public ips work better...
Browse files Browse the repository at this point in the history
Signed-off-by: matthias.gatto <[email protected]>
  • Loading branch information
outscale-mgo committed Nov 23, 2023
1 parent 9028db1 commit 0007001
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions osc_tui/publicIps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from osc_tui import main
from osc_tui import popup
from osc_tui import selectableGrid

class publicIpsGrid(selectableGrid.SelectableGrid):
def __init__(self, screen, *args, **keywords):
super().__init__(screen, *args, **keywords)
self.col_titles = ["Id", "Public Ip", "Vm Id"]

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

def refresh(self):
groups = main.do_search(self.data.copy(), ["PublicIpId", "PublicIp", "VmId"])
values = list()
for g in groups:
VmId = g["VmId"] if "VmId" in g else "unattached"
values.append([g['PublicIpId'], g["PublicIp"], VmId])
self.values = values

0 comments on commit 0007001

Please sign in to comment.