[pve-devel] [PATCH cluster v5 07/17] return cluster config and authkey in addnode API call

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jan 26 14:25:17 CET 2018


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 data/PVE/API2/ClusterConfig.pm | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/data/PVE/API2/ClusterConfig.pm b/data/PVE/API2/ClusterConfig.pm
index 76fe7b6..5bdf970 100644
--- a/data/PVE/API2/ClusterConfig.pm
+++ b/data/PVE/API2/ClusterConfig.pm
@@ -136,7 +136,17 @@ __PACKAGE__->register_method ({
 	    },
 	},
     },
-    returns => { type => 'null' },
+    returns => {
+	type => "object",
+	properties => {
+	    corosync_authkey => {
+		type => 'string',
+	    },
+	    corosync_conf => {
+		type => 'string',
+	    }
+	},
+    },
     code => sub {
 	my ($param) = @_;
 
@@ -224,7 +234,15 @@ __PACKAGE__->register_method ({
 	$config_change_lock->($code);
 	die $@ if $@;
 
-	return undef;
+	my $clusterconf = "/etc/pve/corosync.conf";
+	my $authfile = "/etc/corosync/authkey";
+
+	my $res = {
+	    corosync_authkey => PVE::Tools::file_get_contents($authfile),
+	    corosync_conf => PVE::Tools::file_get_contents($clusterconf),
+	};
+
+	return $res;
     }});
 
 
-- 
2.14.2





More information about the pve-devel mailing list