X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=PVE%2FAPI2Tools.pm;fp=PVE%2FAPI2Tools.pm;h=5ab202b499e413f8b994d01a8a1c0bbb36dddaa1;hb=60e049c231350b69bbbd113188c04718f3b8d1f8;hp=4d730901b31d5841ff32115b0ca21a77f585a91e;hpb=c54f9a758d0f9f5a422f0e0e98e00620ed1afd4f;p=pve-manager.git diff --git a/PVE/API2Tools.pm b/PVE/API2Tools.pm index 4d730901..5ab202b4 100644 --- a/PVE/API2Tools.pm +++ b/PVE/API2Tools.pm @@ -16,7 +16,7 @@ use PVE::SafeSyslog; my $hwaddress; sub get_hwaddress { - + return $hwaddress if defined ($hwaddress); my $fn = '/etc/ssh/ssh_host_rsa_key.pub'; @@ -69,7 +69,7 @@ sub extract_vm_stats { my $entry = { id => "$data->{type}/$vmid", - vmid => $vmid + 0, + vmid => $vmid + 0, node => $data->{node}, type => $data->{type}, status => 'unknown', @@ -92,7 +92,7 @@ sub extract_vm_stats { $entry->{netout} = ($d->[10] || 0) + 0; $entry->{diskread} = ($d->[11] || 0) + 0; $entry->{diskwrite} = ($d->[12] || 0) + 0; - + } elsif ($d = $rrd->{"pve2.3-vm/$vmid"}) { $entry->{uptime} = ($d->[0] || 0) + 0; @@ -120,12 +120,12 @@ sub extract_storage_stats { my $entry = { id => "storage/$node/$storeid", - storage => $storeid, - node => $node, - type => 'storage', + storage => $storeid, + node => $node, + type => 'storage', status => 'unknown', shared => $scfg->{shared} || 0, - }; + }; if (my $d = $rrd->{"pve2-storage/$node/$storeid"}) { $entry->{maxdisk} = ($d->[1] || 0) + 0; @@ -164,14 +164,14 @@ sub run_spiceterm { my $nodename = PVE::INotify::nodename(); my $family = PVE::Tools::get_host_address_family($nodename); my $port = PVE::Tools::next_spice_port($family); - - my ($ticket, undef, $remote_viewer_config) = + + my ($ticket, undef, $remote_viewer_config) = PVE::AccessControl::remote_viewer_config($authuser, $vmid, $node, $proxy, $title, $port); - my $timeout = 40; + my $timeout = 40; my $cmd = ['/usr/bin/spiceterm', '--port', $port, '--addr', 'localhost', - '--timeout', $timeout, '--authpath', $authpath, + '--timeout', $timeout, '--authpath', $authpath, '--permissions', $permissions]; my $dcconf = PVE::Cluster::cfs_read_file('datacenter.cfg');