Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #969 from iocage/NAS-102294
Browse files Browse the repository at this point in the history
NAS-102294 / 11.3 / Bug fix for listing admin portal
  • Loading branch information
sonicaj committed Jun 27, 2019
2 parents 697fc7d + abf66f4 commit 812c7b5
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions iocage_lib/ioc_list.py
Expand Up @@ -339,14 +339,22 @@ def list_all(self, jails):

try:
with open(f"{mountpoint}/plugin/ui.json", "r") as u:
ip = full_ip4.split("|", 1)
ip = ip[1] if len(ip) != 1 else ip[0]
all_ips = map(
lambda v: 'DHCP' if 'dhcp' in v.lower() else v,
[
i.split('|')[-1].split('/')[0].strip()
for i in full_ip4.split(',')
]
)

ip = ip.split("/", 1)[0] if "DHCP" not in full_ip4 \
else "DHCP"
ui_data = json.load(u)
admin_portal = ui_data["adminportal"]
admin_portal = admin_portal.replace("%%IP%%", ip)
admin_portal = ','.join(
map(
lambda v: admin_portal.replace('%%IP%%', v),
all_ips
)
)

try:
ph = ui_data["adminportal_placeholders"].items()
Expand Down

0 comments on commit 812c7b5

Please sign in to comment.