Also derefence the given parameters once, for readability

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 src/PVE/CLI/pct.pm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
index 05fcb29..1818551 100755
--- a/src/PVE/CLI/pct.pm
+++ b/src/PVE/CLI/pct.pm
@@ -184,13 +184,14 @@ __PACKAGE__->register_method ({
     code => sub {
        my ($param) = @_;
 
+       my $vmid = $param->{vmid};
+       my @args = @{$param->{'extra-args'}};
+       die "missing command" if !@args;
+
        # test if container exists on this node
-       PVE::LXC::Config->load_config($param->{vmid});
+       PVE::LXC::Config->load_config($vmid);
 
-       if (!@{$param->{'extra-args'}}) {
-           die "missing command";
-       }
-       exec('lxc-attach', '-n', $param->{vmid}, '--', 
@{$param->{'extra-args'}});
+       exec('lxc-attach', '-n', $param->{vmid}, '--', @args);
     }});
 
 __PACKAGE__->register_method ({
-- 
2.11.0


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

Reply via email to