diff --git a/roles/copr/backend/templates/provision/libvirt-new b/roles/copr/backend/templates/provision/libvirt-new index 0accc4af05..cfa4fc57ea 100755 --- a/roles/copr/backend/templates/provision/libvirt-new +++ b/roles/copr/backend/templates/provision/libvirt-new @@ -13,8 +13,8 @@ import logging import subprocess import tempfile import shutil +import shlex import time -import pipes import argparse from helpers import get_hv_identification_from_pool_id @@ -67,7 +67,7 @@ class LibvirtSpawner: """ Run CMD, and log info. """ - self.log.debug("cmd: %s", ' '.join([pipes.quote(str(x)) for x in cmd])) + self.log.debug("cmd: %s", ' '.join([shlex.quote(str(x)) for x in cmd])) start = time.time() status = subprocess.call(cmd, *args, **kwargs) self.log.debug(" -> exit_status=%s, time=%ss", diff --git a/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 b/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 index 83fb2f6f9a..c0a1012ff0 100755 --- a/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 +++ b/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 @@ -7,9 +7,9 @@ Start a new VM in IBM Cloud under the copr-team account. import argparse import datetime import logging -import pipes import os import random +import shlex import subprocess import sys @@ -380,7 +380,7 @@ def _main(): opts.log = log cmd = "source {} ; echo $IBMCLOUD_API_KEY".format( - pipes.quote(opts.token_file)) + shlex.quote(opts.token_file)) output = subprocess.check_output(cmd, shell=True) token = output.decode("utf-8").strip().rsplit("\n", maxsplit=1)[-1] authenticator = IAMAuthenticator(token)