Factor out the common read-only variables to allow the second call to
`storage_check_enabled` to be below 100 characters.

Signed-off-by: Daniel Kral <d.k...@proxmox.com>
---
changes since v1:
- new!

 src/PVE/LXC/Migrate.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index e1e6cab..f06a10a 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -71,7 +71,8 @@ sub prepare {
        die "can't determine assigned storage for mount point '$ms'\n" if 
!$storage;
 
        # check if storage is available on both nodes
-       my $scfg = PVE::Storage::storage_check_enabled($self->{storecfg}, 
$storage);
+       my ($storecfg, $node) = $self->@{qw(storecfg node)};
+       my $scfg = PVE::Storage::storage_check_enabled($storecfg, $storage);
 
        my $targetsid = $storage;
 
@@ -92,7 +93,7 @@ sub prepare {
        }
 
        if (!$remote) {
-           my $target_scfg = 
PVE::Storage::storage_check_enabled($self->{storecfg}, $targetsid, 
$self->{node});
+           my $target_scfg = PVE::Storage::storage_check_enabled($storecfg, 
$targetsid, $node);
 
            die "$volid: content type 'rootdir' is not available on storage 
'$targetsid'\n"
                if !$target_scfg->{content}->{rootdir};
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to