backend: fix Python 3.12 warning on F37

/var/lib/resallocserver/provision/libvirt-new:17: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
  import pipes
This commit is contained in:
Pavel Raiskup 2022-11-23 11:28:55 +01:00
parent 4fd58b6c40
commit 093a5aceb7
2 changed files with 4 additions and 4 deletions

View file

@ -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",

View file

@ -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)