]> git.proxmox.com Git - pve-container.git/commitdiff
clone: code bloat reduction
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 14 Oct 2021 09:59:34 +0000 (11:59 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 14 Oct 2021 09:59:34 +0000 (11:59 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/LXC.pm

index 05cfbad7b3750df8110d5436765cb57bd2d80900..69df3663d4a6cf98e66b9fde881e77e1f66a0e65 100644 (file)
@@ -1513,20 +1513,13 @@ __PACKAGE__->register_method({
            $newconf->{lock} = 'create';
 
            # delete all snapshot related config options
-           delete $newconf->{snapshots};
-           delete $newconf->{parent};
-           delete $newconf->{snaptime};
-           delete $newconf->{snapstate};
+           delete $newconf->@{qw(snapshots parent snaptime snapstate)};
 
            delete $newconf->{pending};
            delete $newconf->{template};
-           if ($param->{hostname}) {
-               $newconf->{hostname} = $param->{hostname};
-           }
 
-           if ($param->{description}) {
-               $newconf->{description} = $param->{description};
-           }
+           $newconf->{hostname} = $param->{hostname} if $param->{hostname};
+           $newconf->{description} = $param->{description} if $param->{description};
 
            $lock_and_reload->($newid, sub {
                PVE::LXC::Config->write_config($newid, $newconf);