Add a nocolor setting to ansible.cfg

This commit is contained in:
Abhijit Menon-Sen 2013-08-08 21:37:33 +05:30
parent 067cc9274d
commit 0c96d8af6e
3 changed files with 7 additions and 1 deletions

View file

@ -17,9 +17,10 @@
import os
import sys
import constants
ANSIBLE_COLOR=True
if os.getenv("ANSIBLE_NOCOLOR") is not None:
if constants.ANSIBLE_NOCOLOR is not None:
ANSIBLE_COLOR=False
elif not hasattr(sys.stdout, 'isatty') or not sys.stdout.isatty():
ANSIBLE_COLOR=False