[pve-devel] [PATCH cluster v3 06/14] return cluster config and authkey in addnode API call

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Dec 19 12:52:31 CET 2017


---

no changes

 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 5b0aca8..ca2e038 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.11.0





More information about the pve-devel mailing list