mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
updated ansible-playbook to use display, fixed issues breaking display class
This commit is contained in:
parent
e6e69c0894
commit
af97e732a0
4 changed files with 25 additions and 34 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue