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: