From d44daf53cce737521d14f4a81b59f1ebdcea2f89 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Thu, 6 Aug 2015 17:20:07 -0400 Subject: [PATCH] Allow wrapped text in deprecated messages --- lib/ansible/utils/display.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/utils/display.py b/lib/ansible/utils/display.py index fa16b7af05c..d7b3212e3c8 100644 --- a/lib/ansible/utils/display.py +++ b/lib/ansible/utils/display.py @@ -161,11 +161,11 @@ class Display: else: raise AnsibleError("[DEPRECATED]: %s. Please update your playbooks." % msg) - wrapped = textwrap.wrap(new_msg, 79) - new_msg = "\n".join(wrapped) + "\n" + wrapped = textwrap.wrap(new_msg, 79, replace_whitespace=False, drop_whitespace=False) + new_msg = "\n".join(wrapped) if new_msg not in self._deprecations: - self.display(new_msg, color='purple', stderr=True) + self.display(new_msg.strip(), color='purple', stderr=True) self._deprecations[new_msg] = 1 def warning(self, msg):