iSCSI support, audit wizard, CSV improvements, bug fixes #1
@@ -197,8 +197,7 @@ def _prompt_iscsi_portals(iscsi: dict) -> None:
|
|||||||
for portal in portals:
|
for portal in portals:
|
||||||
comment = portal.get("comment", "")
|
comment = portal.get("comment", "")
|
||||||
listen = portal.get("listen", [])
|
listen = portal.get("listen", [])
|
||||||
src_ips = " ".join(f"{l['ip']}:{l['port']}" for l in listen)
|
src_ips = " ".join(f"{l['ip']}" for l in listen)
|
||||||
default_port = listen[0]["port"] if listen else 3260
|
|
||||||
|
|
||||||
label = f"Portal {portal['id']}" + (f" ({comment!r})" if comment else "")
|
label = f"Portal {portal['id']}" + (f" ({comment!r})" if comment else "")
|
||||||
print(f"\n {_bold(label)}")
|
print(f"\n {_bold(label)}")
|
||||||
@@ -209,11 +208,9 @@ def _prompt_iscsi_portals(iscsi: dict) -> None:
|
|||||||
print(f" {_yellow('⚠')} No IPs entered — keeping source IPs.")
|
print(f" {_yellow('⚠')} No IPs entered — keeping source IPs.")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
port_raw = _prompt(" Port", default=str(default_port))
|
|
||||||
port = int(port_raw) if port_raw.isdigit() else default_port
|
|
||||||
dest_ips = raw.split()
|
dest_ips = raw.split()
|
||||||
portal["listen"] = [{"ip": ip, "port": port} for ip in dest_ips]
|
portal["listen"] = [{"ip": ip} for ip in dest_ips]
|
||||||
print(f" {_green('✓')} Portal: {', '.join(f'{ip}:{port}' for ip in dest_ips)}")
|
print(f" {_green('✓')} Portal: {', '.join(dest_ips)}")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -179,7 +179,10 @@ def _iscsi_initiator_payload(initiator: dict) -> dict:
|
|||||||
|
|
||||||
|
|
||||||
def _iscsi_portal_payload(portal: dict) -> dict:
|
def _iscsi_portal_payload(portal: dict) -> dict:
|
||||||
return {k: v for k, v in portal.items() if k not in _ISCSI_PORTAL_READONLY}
|
payload = {k: v for k, v in portal.items() if k not in _ISCSI_PORTAL_READONLY}
|
||||||
|
# The API only accepts {"ip": "..."} in listen entries — port is a global setting
|
||||||
|
payload["listen"] = [{"ip": l["ip"]} for l in payload.get("listen", [])]
|
||||||
|
return payload
|
||||||
|
|
||||||
|
|
||||||
def _iscsi_target_payload(
|
def _iscsi_target_payload(
|
||||||
|
|||||||
Reference in New Issue
Block a user