Compare commits

..

6 Commits

Author SHA1 Message Date
da1074c8ad Merge pull request 'Update README' (#2) from devel into main 2026-03-05 16:10:56 -05:00
82bff2d341 Merge devel: iSCSI support, audit wizard, CSV improvements, bug fixes 2026-03-05 16:08:43 -05:00
44e71fd3a5 Merge branch 'devel' 2026-03-05 11:34:29 -05:00
93b6cd136c Merge devel: add README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 22:18:11 -05:00
3f98fa4843 Merge devel: rename shim to deploy.py
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 22:14:59 -05:00
c4c5a3c7bf Merge devel: restructure into package, remove SMB config migration
- Split single-file script into truenas_migrate/ package
- Removed SMB global config migration (not needed for deployment use)
- Added compatibility shim so both invocation styles still work
- Added __pycache__ to .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 22:05:27 -05:00

View File

@@ -386,24 +386,21 @@ async def _migrate_iscsi_targets(
summary.iscsi_targets_skipped += 1 summary.iscsi_targets_skipped += 1
continue continue
# Filter out groups whose portal or initiator could not be mapped (e.g. portal # Verify all referenced portals and initiators were successfully mapped
# creation failed). Warn per dropped group but still create the target — a missing = []
# target without every portal group is valid and preferable to no target at all.
valid_groups = []
for g in target.get("groups", []): for g in target.get("groups", []):
unmapped = []
if g.get("portal") not in portal_id_map: if g.get("portal") not in portal_id_map:
unmapped.append(f"portal id={g['portal']}") missing.append(f"portal id={g['portal']}")
if g.get("initiator") not in initiator_id_map: if g.get("initiator") not in initiator_id_map:
unmapped.append(f"initiator id={g['initiator']}") missing.append(f"initiator id={g['initiator']}")
if unmapped: if missing:
log.warning(" %s dropping group with unmapped %s", msg = f"iSCSI target {name!r}: cannot remap {', '.join(missing)}"
_yellow("WARN"), ", ".join(unmapped)) log.error(" %s: %s", _bold_red("SKIP"), msg)
else: summary.iscsi_targets_failed += 1
valid_groups.append(g) summary.errors.append(msg)
continue
payload = _iscsi_target_payload({**target, "groups": valid_groups}, payload = _iscsi_target_payload(target, portal_id_map, initiator_id_map)
portal_id_map, initiator_id_map)
log.debug(" payload: %s", json.dumps(payload)) log.debug(" payload: %s", json.dumps(payload))
if dry_run: if dry_run: