From aebadaacdf7522252ab542299884b1bf0026808e Mon Sep 17 00:00:00 2001 From: fazledyn-or Date: Wed, 8 Nov 2023 17:59:06 +0600 Subject: [PATCH] Replaced `mktemp` with `mkstemp` Signed-off-by: fazledyn-or --- teuthology/openstack/__init__.py | 3 ++- teuthology/provision/openstack.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/teuthology/openstack/__init__.py b/teuthology/openstack/__init__.py index bdfde29566..0f626e55c9 100644 --- a/teuthology/openstack/__init__.py +++ b/teuthology/openstack/__init__.py @@ -1026,7 +1026,8 @@ ssh access : ssh {identity}{username}@{ip} # logs in /usr/share/nginx/ cluster, based on a template where the OpenStack credentials and a few other values are substituted. """ - path = tempfile.mktemp() + fd, path = tempfile.mkstemp() + os.close(fd) with open(os.path.dirname(__file__) + '/bootstrap-teuthology.sh', 'rb') as f: b64_bootstrap = base64.b64encode(f.read()) diff --git a/teuthology/provision/openstack.py b/teuthology/provision/openstack.py index f8d3eda85a..d829b4ee55 100644 --- a/teuthology/provision/openstack.py +++ b/teuthology/provision/openstack.py @@ -27,7 +27,8 @@ class ProvisionOpenStack(OpenStack): """ def __init__(self): super(ProvisionOpenStack, self).__init__() - self.user_data = tempfile.mktemp() + fd, self.user_data = tempfile.mkstemp() + os.close(fd) log.debug("ProvisionOpenStack: " + str(config.openstack)) self.basename = 'target' self.up_string = 'The system is finally up' -- 2.39.5