[pve-devel] [PATCH RFC 08/21] updatecerts: change order - first update files on /etc/pve

Dietmar Maurer dietmar at proxmox.com
Mon Nov 28 08:09:00 CET 2016


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 data/PVE/CLI/pvecm.pm | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/data/PVE/CLI/pvecm.pm b/data/PVE/CLI/pvecm.pm
index 49135d3..e47c3d3 100755
--- a/data/PVE/CLI/pvecm.pm
+++ b/data/PVE/CLI/pvecm.pm
@@ -811,27 +811,29 @@ __PACKAGE__->register_method ({
     code => sub {
 	my ($param) = @_;
 
+	my $nodename = PVE::INotify::nodename();
+
+	my $quorate = PVE::Cluster::check_cfs_quorum(1);
+
+	if ($quorate) {
+	    my $local_ip_address = PVE::Cluster::remote_node_ip($nodename);
+
+	    PVE::Cluster::gen_pve_node_files($nodename, $local_ip_address, $param->{force});
+	    PVE::Cluster::setup_ssh_keys();
+	    PVE::Cluster::ssh_merge_keys();
+	    PVE::Cluster::ssh_merge_known_hosts($nodename, $local_ip_address);
+	    PVE::Cluster::gen_pve_vzdump_files();
+	}
+
 	PVE::Cluster::setup_sshd_config(0);
 	PVE::Cluster::setup_rootsshconfig();
-
 	PVE::Cluster::gen_pve_vzdump_symlink();
 
-	if (!PVE::Cluster::check_cfs_quorum(1)) {
+	if (!$quorate) {
 	    return undef if $param->{silent};
 	    die "no quorum - unable to update files\n";
 	}
 
-	PVE::Cluster::setup_ssh_keys();
-
-	my $nodename = PVE::INotify::nodename();
-
-	my $local_ip_address = PVE::Cluster::remote_node_ip($nodename);
-
-	PVE::Cluster::gen_pve_node_files($nodename, $local_ip_address, $param->{force});
-	PVE::Cluster::ssh_merge_keys();
-	PVE::Cluster::ssh_merge_known_hosts($nodename, $local_ip_address);
-	PVE::Cluster::gen_pve_vzdump_files();
-
 	return undef;
     }});
 
-- 
2.1.4




More information about the pve-devel mailing list