diff options
author | boucherv <valentin.boucher@orange.com> | 2017-07-02 16:26:57 +0200 |
---|---|---|
committer | boucherv <valentin.boucher@orange.com> | 2017-07-02 16:30:12 +0200 |
commit | 73b978908c85f752862d08a209ee64e013369710 (patch) | |
tree | 889084ba6493f8c9864b386dc0dcc5fadba7c502 | |
parent | e25472fad7c7494f6ee71d8fd79f1410b9406844 (diff) |
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 <valentin.boucher@orange.com>
-rw-r--r-- | snaps/openstack/create_keypairs.py | 4 |
1 files changed, 4 insertions, 0 deletions
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 |