mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 05:55:28 +00:00
[#2696] hammer.py: replace ~ with os.environ['HOME']
On rare occasion, the previously-used execute() would return empty output, which would cause the path to change, often resulting in a 'no such file or directory' error.
This commit is contained in:
@@ -335,7 +335,7 @@ def execute(cmd, timeout=60, cwd=None, env=None, raise_error=True, dry_run=False
|
||||
quiet = True
|
||||
if cwd and "~/" in cwd:
|
||||
# replace relative home directory
|
||||
cwd = cwd.replace('~', execute('cd ~ && pwd', capture=True, super_quiet=True)[1].rstrip())
|
||||
cwd = cwd.replace('~', os.environ['HOME'])
|
||||
if not super_quiet:
|
||||
log.info('>>>>> Executing %s in %s', cmd, cwd if cwd else os.getcwd())
|
||||
if not check_times:
|
||||
|
Reference in New Issue
Block a user