]> git.proxmox.com Git - pve-container.git/commitdiff
api status: use own variable for frequent hash use
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 10 May 2019 10:04:37 +0000 (10:04 +0000)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 10 May 2019 10:04:37 +0000 (10:04 +0000)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/LXC/Status.pm

index 7c9c6f103b85c12d96fb8d87645bf83c70c4c79b..c893f3cfd8256987a016051b336fe4c92b7cd174 100644 (file)
@@ -101,12 +101,13 @@ __PACKAGE__->register_method({
        my ($param) = @_;
 
        # test if VM exists
-       my $conf = PVE::LXC::Config->load_config($param->{vmid});
+       my $vmid = $param->{vmid};
+       my $conf = PVE::LXC::Config->load_config($vmid);
 
-       my $vmstatus =  PVE::LXC::vmstatus($param->{vmid});
-       my $status = $vmstatus->{$param->{vmid}};
+       my $vmstatus = PVE::LXC::vmstatus($vmid);
+       my $status = $vmstatus->{$vmid};
 
-       $status->{ha} = PVE::HA::Config::get_service_status("ct:$param->{vmid}");
+       $status->{ha} = PVE::HA::Config::get_service_status("ct:$vmid");
 
        return $status;
     }});