From 85696fe00212aed18a0604730c0c921094807d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Inderm=C3=BChle?= Date: Thu, 23 Jun 2022 13:04:20 +0200 Subject: [PATCH] Add dedpulication to command construct Co-authored-by: Andrew Klychkov --- plugins/modules/mysql_db.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/modules/mysql_db.py b/plugins/modules/mysql_db.py index cd63046..0830a12 100644 --- a/plugins/modules/mysql_db.py +++ b/plugins/modules/mysql_db.py @@ -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)