]> git.proxmox.com Git - pve-container.git/commitdiff
allow to load configs from CTs located on other nodes
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 26 Aug 2015 13:36:28 +0000 (15:36 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 26 Aug 2015 14:12:33 +0000 (16:12 +0200)
This allows load_config to load also configs from LXC container
which arent't located on the same node.

This is needed to fix the bug that doesn't let view the noVNC
console from an CT located on another node, whereas viewing it on
the same node as the container is located works fine.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/LXC.pm
src/PVE/LXC.pm

index 8431125b9f344b3b7c568cb89ba661aedb7921e6..e9bd5a75c0256830ebce10cd07231e8b04532889 100644 (file)
@@ -593,7 +593,7 @@ __PACKAGE__->register_method ({
        my $remcmd = $remip ?
            ['/usr/bin/ssh', '-t', $remip] : [];
 
-       my $conf = PVE::LXC::load_config($vmid);
+       my $conf = PVE::LXC::load_config($vmid, $node);
        my $concmd = PVE::LXC::get_console_command($vmid, $conf);
 
        my $shcmd = [ '/usr/bin/dtach', '-A',
index 982db2d418c2faaa7a02d9d06afbed0fb4b2f586..f629b88e22173ebac835135eeaa96fe4fe25aa1b 100644 (file)
@@ -439,9 +439,10 @@ sub config_file {
 }
 
 sub load_config {
-    my ($vmid) = @_;
+    my ($vmid, $node) = @_;
 
-    my $cfspath = cfs_config_path($vmid);
+    $node = $nodename if !$node;
+    my $cfspath = cfs_config_path($vmid, $node);
 
     my $conf = PVE::Cluster::cfs_read_file($cfspath);
     die "container $vmid does not exists\n" if !defined($conf);