Allow wrapped text in deprecated messages

This commit is contained in:
James Cammarata 2015-08-06 17:20:07 -04:00
commit d44daf53cc

View file

@ -161,11 +161,11 @@ class Display:
else: else:
raise AnsibleError("[DEPRECATED]: %s. Please update your playbooks." % msg) raise AnsibleError("[DEPRECATED]: %s. Please update your playbooks." % msg)
wrapped = textwrap.wrap(new_msg, 79) wrapped = textwrap.wrap(new_msg, 79, replace_whitespace=False, drop_whitespace=False)
new_msg = "\n".join(wrapped) + "\n" new_msg = "\n".join(wrapped)
if new_msg not in self._deprecations: 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 self._deprecations[new_msg] = 1
def warning(self, msg): def warning(self, msg):