]> git.proxmox.com Git - pve-container.git/commitdiff
followup: code cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 4 Mar 2019 11:29:03 +0000 (12:29 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 4 Mar 2019 11:29:03 +0000 (12:29 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/LXC.pm

index 1cc29790b431a4ba070ed6f398c818804c1e0006..b10abcb14659fc163058ab98dc0af8d8e48ca824 100644 (file)
@@ -331,10 +331,10 @@ __PACKAGE__->register_method({
            my $vollist = [];
            eval {
                my $orig_mp_param; # only used if $restore
-               my $orig_conf;
                if ($restore) {
                    die "can't overwrite running container\n" if PVE::LXC::check_running($vmid);
                    if ($is_root && $archive ne '-') {
+                       my $orig_conf;
                        ($orig_conf, $orig_mp_param) = PVE::LXC::Create::recover_config($archive);
                        # When we're root call 'restore_configuration' with ristricted=0,
                        # causing it to restore the raw lxc entries, among which there may be
@@ -345,7 +345,7 @@ __PACKAGE__->register_method({
                }
                if ($storage_only_mode) {
                    if ($restore) {
-                       if (!defined $orig_mp_param) {
+                       if (!defined($orig_mp_param)) {
                            (undef, $orig_mp_param) = PVE::LXC::Create::recover_config($archive);
                        }
                        $mp_param = $orig_mp_param;