Add dedpulication to command construct

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
Laurent Indermühle 2022-06-23 13:04:20 +02:00 committed by GitHub
commit 85696fe002
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -437,10 +437,10 @@ 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 and path:
cmd = 'set -o pipefail && %s | %s > %s' % (cmd, path, shlex_quote(target))
elif path:
if path:
cmd = '%s | %s > %s' % (cmd, path, shlex_quote(target))
if pipefail:
cmd = 'set -o pipefail && ' + cmd
else:
cmd += " > %s" % shlex_quote(target)