From bb993dc87730e8998f0a2225bbd5de4bbf27cba8 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 5 Aug 2021 17:08:17 -0400 Subject: [PATCH] ensure we convert path in warning or py2.6 breaks (#75413) (#75414) (cherry picked from commit 75e6bdb5799ffb310bca9fee0707b5c6ffb15cc5) --- changelogs/fragments/find_error_fix.yml | 2 ++ lib/ansible/modules/find.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/find_error_fix.yml diff --git a/changelogs/fragments/find_error_fix.yml b/changelogs/fragments/find_error_fix.yml new file mode 100644 index 00000000000..c4dcbd5a2f0 --- /dev/null +++ b/changelogs/fragments/find_error_fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - find action, correctly convert path to text when warning about skiping. diff --git a/lib/ansible/modules/find.py b/lib/ansible/modules/find.py index 7db5004ca34..ca8b483b165 100644 --- a/lib/ansible/modules/find.py +++ b/lib/ansible/modules/find.py @@ -493,7 +493,7 @@ def main(): if not params['recurse']: break except Exception as e: - warn = "Skipped '%s' path due to this access issue: %s\n" % (npath, to_text(e)) + warn = "Skipped '%s' path due to this access issue: %s\n" % (to_text(npath), to_text(e)) module.warn(warn) msg += warn