diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-07-19 21:32:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-19 21:32:42 +0200 |
| commit | fb6f19f186296f42057cd1685d6f3bb63a5dae39 (patch) | |
| tree | 9c1deaf6c985ee5a040846ec2cd2f455efc45329 /src/migration-scripts | |
| parent | 43093ec740b6350492e4d4d16617ddf638ee4b94 (diff) | |
| parent | e0684c0c343835c7674a94424d847592511915b0 (diff) | |
| download | vyos-1x-fb6f19f186296f42057cd1685d6f3bb63a5dae39.tar.gz vyos-1x-fb6f19f186296f42057cd1685d6f3bb63a5dae39.zip | |
Merge pull request #5323 from c-po/cmdl-migration
utils: T9008: migrate remaining cmd() callers to cmdl() and remove cmd()
Diffstat (limited to 'src/migration-scripts')
| -rw-r--r-- | src/migration-scripts/https/5-to-6 | 4 | ||||
| -rw-r--r-- | src/migration-scripts/system/13-to-14 | 4 |
2 files changed, 4 insertions, 4 deletions
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, '') diff --git a/src/migration-scripts/system/13-to-14 b/src/migration-scripts/system/13-to-14 index 3632b4b6a..0a0d4ef67 100644 --- a/src/migration-scripts/system/13-to-14 +++ b/src/migration-scripts/system/13-to-14 @@ -24,7 +24,7 @@ import re from vyos.configtree import ConfigTree -from vyos.utils.process import cmd +from vyos.utils.process import cmdl tz_base = ['system', 'time-zone'] @@ -38,7 +38,7 @@ def migrate(config: ConfigTree) -> None: # retrieve all valid timezones try: - tz_data_raw = cmd('timedatectl list-timezones') + tz_data_raw = cmdl(['timedatectl', 'list-timezones']) except OSError: tz_data_raw = '' tz_data = tz_data_raw.split('\n') |
