summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/create_keypairs.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-11-09 15:07:15 -0700
committerspisarski <s.pisarski@cablelabs.com>2017-11-09 15:07:15 -0700
commitd41992fe773fc88d8aa32723c93df8ba2e1c75b7 (patch)
treedca51dfd789a96d60b57d1ab2835a19369d107a2 /snaps/openstack/create_keypairs.py
parentb59094ae4f53e0da4e4a5fb7c2aece3647d23b8d (diff)
Deleting files created when obtaining keypair settings from heat.
When Heat creates a keypair and SNAPS-OO attempts to generate a KeypairSettings object, the private key is getting stored into a file that was not getting cleaned up in some of the tests. JIRA: SNAPS-177 Change-Id: I50759a74efbd1d0df4de0780da43b9e56432d28c Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/create_keypairs.py')
-rw-r--r--snaps/openstack/create_keypairs.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/snaps/openstack/create_keypairs.py b/snaps/openstack/create_keypairs.py
index 3869afc..6c66134 100644
--- a/snaps/openstack/create_keypairs.py
+++ b/snaps/openstack/create_keypairs.py
@@ -123,6 +123,7 @@ class OpenStackKeypair(OpenStackComputeObject):
self.keypair_settings.public_filepath)
os.chmod(expanded_path, 0o755)
os.remove(expanded_path)
+ logger.info('Deleted public key file [%s]', expanded_path)
if (self.keypair_settings.private_filepath and
file_utils.file_exists(
self.keypair_settings.private_filepath)):
@@ -130,6 +131,7 @@ class OpenStackKeypair(OpenStackComputeObject):
self.keypair_settings.private_filepath)
os.chmod(expanded_path, 0o755)
os.remove(expanded_path)
+ logger.info('Deleted private key file [%s]', expanded_path)
def get_keypair(self):
"""