From 39df71dfaacc508870dd8de8da0d70ed90474445 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 20 Aug 2013 09:02:38 +0200 Subject: [PATCH] avoid warning when adding a new node Signed-off-by: Dietmar Maurer --- Makefile | 4 ++-- data/PVE/Cluster.pm | 14 +++++++------- data/PVE/pvecm | 3 ++- debian/changelog | 8 ++++++++ 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index d97bd50..d8bac5f 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -RELEASE=3.0 +RELEASE=3.1 PACKAGE=pve-cluster PKGVER=3.0 -PKGREL=5 +PKGREL=6 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) diff --git a/data/PVE/Cluster.pm b/data/PVE/Cluster.pm index 63b06b6..6054277 100644 --- a/data/PVE/Cluster.pm +++ b/data/PVE/Cluster.pm @@ -141,7 +141,7 @@ sub gen_auth_key { check_cfs_is_mounted(); - mkdir $authdir || die "unable to create dir '$authdir' - $!\n"; + -d $authdir || mkdir $authdir || die "unable to create dir '$authdir' - $!\n"; my $cmd = "openssl genrsa -out '$authprivkeyfn' 2048"; run_silent_cmd($cmd); @@ -1047,6 +1047,12 @@ sub ssh_merge_keys { sub setup_rootsshconfig { + # create ssh key if it does not exist + if (! -f $ssh_rsa_id) { + mkdir '/root/.ssh/'; + system ("echo|ssh-keygen -t rsa -N '' -b 2048 -f ${ssh_rsa_id_priv}"); + } + # create ssh config if it does not exist if (! -f $rootsshconfig) { mkdir '/root/.ssh'; @@ -1060,12 +1066,6 @@ sub setup_rootsshconfig { sub setup_ssh_keys { - # create ssh key if it does not exist - if (! -f $ssh_rsa_id) { - mkdir '/root/.ssh/'; - system ("echo|ssh-keygen -t rsa -N '' -b 2048 -f ${ssh_rsa_id_priv}"); - } - mkdir $authdir; my $import_ok; diff --git a/data/PVE/pvecm b/data/PVE/pvecm index 04bbc87..5a7074f 100755 --- a/data/PVE/pvecm +++ b/data/PVE/pvecm @@ -606,7 +606,6 @@ __PACKAGE__->register_method ({ my ($param) = @_; PVE::Cluster::setup_rootsshconfig(); - PVE::Cluster::setup_ssh_keys(); PVE::Cluster::gen_pve_vzdump_symlink(); @@ -615,6 +614,8 @@ __PACKAGE__->register_method ({ die "no quorum - unable to update files\n"; } + PVE::Cluster::setup_ssh_keys(); + 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); diff --git a/debian/changelog b/debian/changelog index 75abf94..42c7b39 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +pve-cluster (3.0-6) unstable; urgency=low + + * avoid warning when adding a new node (can't create shared ssh key database...) + + * avoid warning if /etc/pve/priv/ already exists + + -- Proxmox Support Team Tue, 20 Aug 2013 08:58:17 +0200 + pve-cluster (3.0-5) unstable; urgency=low * add migration_unsecure param to datacenter.cfg -- 2.39.5