From e0684c0c343835c7674a94424d847592511915b0 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 9 Jul 2026 22:21:52 +0200 Subject: utils: T9008: migrate remaining cmd() callers to cmdl() and remove cmd() Complete the safer-subprocess migration started by the cmdl()/ifconfig refactoring and convert every remaining vyos.utils.process.cmd() call site to the list-based cmdl(). Drop the vyos.utils.process.cmd() implementation as it is no longer in use. --- src/migration-scripts/https/5-to-6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/migration-scripts/https') diff --git a/src/migration-scripts/https/5-to-6 b/src/migration-scripts/https/5-to-6 index 8c41f4b61..ece407a4b 100644 --- a/src/migration-scripts/https/5-to-6 +++ b/src/migration-scripts/https/5-to-6 @@ -21,7 +21,7 @@ import os from vyos.configtree import ConfigTree from vyos.defaults import directories -from vyos.utils.process import cmd +from vyos.utils.process import cmdl vyos_certbot_dir = directories['certbot'] @@ -45,7 +45,7 @@ def migrate(config: ConfigTree) -> None: # This must be run as root certbot_live = f'{vyos_certbot_dir}/live/' # we need the trailing / if os.path.exists(certbot_live): - tmp = cmd(f'sudo find {certbot_live} -maxdepth 1 -type d') + tmp = cmdl(['find', certbot_live, '-maxdepth', '1', '-type', 'd'], sudo=True) tmp = tmp.split() # tmp = ['/config/auth/letsencrypt/live', '/config/auth/letsencrypt/live/router.vyos.net'] tmp.remove(certbot_live) cert_name = tmp[0].replace(certbot_live, '') -- cgit v1.2.3