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:
parent
4fd58b6c40
commit
093a5aceb7
2 changed files with 4 additions and 4 deletions
|
@ -13,8 +13,8 @@ import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
import shutil
|
import shutil
|
||||||
|
import shlex
|
||||||
import time
|
import time
|
||||||
import pipes
|
|
||||||
import argparse
|
import argparse
|
||||||
from helpers import get_hv_identification_from_pool_id
|
from helpers import get_hv_identification_from_pool_id
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class LibvirtSpawner:
|
||||||
"""
|
"""
|
||||||
Run CMD, and log info.
|
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()
|
start = time.time()
|
||||||
status = subprocess.call(cmd, *args, **kwargs)
|
status = subprocess.call(cmd, *args, **kwargs)
|
||||||
self.log.debug(" -> exit_status=%s, time=%ss",
|
self.log.debug(" -> exit_status=%s, time=%ss",
|
||||||
|
|
|
@ -7,9 +7,9 @@ Start a new VM in IBM Cloud under the copr-team account.
|
||||||
import argparse
|
import argparse
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
import pipes
|
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ def _main():
|
||||||
opts.log = log
|
opts.log = log
|
||||||
|
|
||||||
cmd = "source {} ; echo $IBMCLOUD_API_KEY".format(
|
cmd = "source {} ; echo $IBMCLOUD_API_KEY".format(
|
||||||
pipes.quote(opts.token_file))
|
shlex.quote(opts.token_file))
|
||||||
output = subprocess.check_output(cmd, shell=True)
|
output = subprocess.check_output(cmd, shell=True)
|
||||||
token = output.decode("utf-8").strip().rsplit("\n", maxsplit=1)[-1]
|
token = output.decode("utf-8").strip().rsplit("\n", maxsplit=1)[-1]
|
||||||
authenticator = IAMAuthenticator(token)
|
authenticator = IAMAuthenticator(token)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue