Skip to content

Commit 39c604b

Browse files
committed
Add missing quoting when remove invalid paths in files.* operations.
1 parent 7b7bdc1 commit 39c604b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyinfra/operations/files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,9 +985,9 @@ def _raise_or_remove_invalid_path(fs_type, path, force, force_backup, force_back
985985
backup_path = '{0}.{1}'.format(path, get_timestamp())
986986
if force_backup_dir:
987987
backup_path = '{0}/{1}'.format(force_backup_dir, backup_path)
988-
yield 'mv {0} {1}'.format(path, backup_path)
988+
yield StringCommand('mv', QuoteString(path), QuoteString(backup_path))
989989
else:
990-
yield 'rm -rf {0}'.format(path)
990+
yield StringCommand('rm', '-rf', QuoteString(path))
991991
else:
992992
raise OperationError('{0} exists and is not a {1}'.format(path, fs_type))
993993

0 commit comments

Comments
 (0)