Skip to content

Commit c5524e2

Browse files
Security enabled lvol restore fix (#943)
* Fixing security backup restore issue * Updating env var * Changing env var to main --------- Co-authored-by: Hamdy H. Khader <hamdy.khader@gmail.com>
1 parent e55cc7d commit c5524e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

simplyblock_core/controllers/backup_controller.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ def restore_backup(backup_id, lvol_name, pool_id_or_name, cluster_id=None,
449449
if not target_node.lvstore:
450450
return None, f"Target node {restore_node_id} has no lvstore (S3 bdev requires lvstore)"
451451

452+
logger.info(f"Backup allowed hosts: {backup.allowed_hosts}")
452453
lvol_id, error = lvol_controller.add_lvol_ha(
453454
name=lvol_name,
454455
size=size,
@@ -466,7 +467,8 @@ def restore_backup(backup_id, lvol_name, pool_id_or_name, cluster_id=None,
466467
use_comp=False,
467468
distr_vuid=0,
468469
lvol_priority_class=0,
469-
allowed_hosts=backup.allowed_hosts,
470+
allowed_hosts=[h["nqn"] if isinstance(h, dict) else h
471+
for h in (backup.allowed_hosts or [])] or None,
470472
fabric="tcp",
471473
)
472474
if error or not lvol_id:

0 commit comments

Comments
 (0)