From eae5df27e8ca6f1238e2847f356e3c04d701a107 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Wed, 22 Jun 2022 17:14:11 +0200 Subject: [PATCH] Fix "bash command not found" if pipefail is used for uncompressed dump --- plugins/modules/mysql_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/mysql_db.py b/plugins/modules/mysql_db.py index 462973d..f94633d 100644 --- a/plugins/modules/mysql_db.py +++ b/plugins/modules/mysql_db.py @@ -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))