From: boucherv Date: Sun, 2 Jul 2017 14:26:57 +0000 (+0200) Subject: Add a warning of keypair creation X-Git-Tag: opnfv-5.0.0~88^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F31%2F36831%2F2;p=snaps.git Add a warning of keypair creation Put a warning if the public key already exist in OpenStack but the private key file is not found Change-Id: Ie2dc5b9f6a6abb0831e1826130d5c283cf3f34ec Signed-off-by: boucherv --- diff --git a/snaps/openstack/create_keypairs.py b/snaps/openstack/create_keypairs.py index cf5a93d..83cfbbc 100644 --- a/snaps/openstack/create_keypairs.py +++ b/snaps/openstack/create_keypairs.py @@ -75,6 +75,10 @@ class OpenStackKeypair: keys, self.keypair_settings.public_filepath, self.keypair_settings.private_filepath) self.__delete_keys_on_clean = True + elif self.__keypair and not os.path.isfile( + self.keypair_settings.private_filepath): + logger.warn("The public key already exist in OpenStack \ + but the private key file is not found ..") return self.__keypair