From 5d4bcea14935c49e351ee4e3643bb705fc13bb01 Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Tue, 17 Sep 2019 11:16:00 -0400 Subject: [PATCH] [stable-2.9] Remove leading space in warning messages (#62002) ci_complete (cherry picked from commit ea6e96985a) Co-authored-by: Sam Doran --- .../fragments/display-warning-remove-erroneous-space.yaml | 2 ++ lib/ansible/utils/display.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/display-warning-remove-erroneous-space.yaml diff --git a/changelogs/fragments/display-warning-remove-erroneous-space.yaml b/changelogs/fragments/display-warning-remove-erroneous-space.yaml new file mode 100644 index 00000000000..9463d67344e --- /dev/null +++ b/changelogs/fragments/display-warning-remove-erroneous-space.yaml @@ -0,0 +1,2 @@ +bugfixes: + - display - remove leading space when displaying WARNING messages diff --git a/lib/ansible/utils/display.py b/lib/ansible/utils/display.py index f06777de885..9fa31a8a4db 100644 --- a/lib/ansible/utils/display.py +++ b/lib/ansible/utils/display.py @@ -248,7 +248,7 @@ class Display(with_metaclass(Singleton, object)): def warning(self, msg, formatted=False): if not formatted: - new_msg = "\n[WARNING]: %s" % msg + new_msg = "[WARNING]: %s" % msg wrapped = textwrap.wrap(new_msg, self.columns) new_msg = "\n".join(wrapped) + "\n" else: