updated ansible-playbook to use display, fixed issues breaking display class

This commit is contained in:
Brian Coca 2015-04-04 15:14:40 -04:00
commit af97e732a0
4 changed files with 25 additions and 34 deletions

View file

@ -16,7 +16,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
from __future__ import (absolute_import, division)
__metaclass__ = type
import signal

View file

@ -16,7 +16,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
from __future__ import (absolute_import, division)
__metaclass__ = type
from ansible.errors import AnsibleError, AnsibleParserError

View file

@ -18,6 +18,7 @@
# FIXME: copied mostly from old code, needs py3 improvements
import textwrap
import sys
from ansible import constants as C
from ansible.errors import *
@ -97,15 +98,15 @@ class Display:
new_msg = "\n".join(wrapped) + "\n"
if new_msg not in deprecations:
self._display(new_msg, color='purple', stderr=True)
self.display(new_msg, color='purple', stderr=True)
self._deprecations[new_msg] = 1
def warning(self, msg):
new_msg = "\n[WARNING]: %s" % msg
wrapped = textwrap.wrap(new_msg, 79)
new_msg = "\n".join(wrapped) + "\n"
if new_msg not in warns:
self._display(new_msg, color='bright purple', stderr=True)
if new_msg not in self._warns:
self.display(new_msg, color='bright purple', stderr=True)
self._warns[new_msg] = 1
def system_warning(self, msg):