Fix "bash command not found" if pipefail is used for uncompressed dump

This commit is contained in:
Laurent Indermuehle 2022-06-22 17:14:11 +02:00
commit eae5df27e8
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09

View file

@ -430,7 +430,7 @@ def db_dump(module, host, user, password, db_name, target, all_databases, port,
elif os.path.splitext(target)[-1] == '.xz':
path = module.get_bin_path('xz', True)
if pipefail:
if pipefail and path:
cmd = 'set -o pipefail && %s | %s > %s' % (cmd, path, shlex_quote(target))
elif path:
cmd = '%s | %s > %s' % (cmd, path, shlex_quote(target))