mirror of
https://github.com/ansible/awx.git
synced 2026-03-24 12:25:01 -02:30
Merge pull request #10668 from oweel/devel
Fix ignoring --no-color for awx-manage list_instances command
This commit is contained in:
@@ -25,6 +25,7 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
super(Command, self).__init__()
|
super(Command, self).__init__()
|
||||||
|
no_color = options.get("no_color", False)
|
||||||
|
|
||||||
groups = list(InstanceGroup.objects.all())
|
groups = list(InstanceGroup.objects.all())
|
||||||
ungrouped = Ungrouped()
|
ungrouped = Ungrouped()
|
||||||
@@ -44,6 +45,8 @@ class Command(BaseCommand):
|
|||||||
color = '\033[91m'
|
color = '\033[91m'
|
||||||
if x.enabled is False:
|
if x.enabled is False:
|
||||||
color = '\033[90m[DISABLED] '
|
color = '\033[90m[DISABLED] '
|
||||||
|
if no_color:
|
||||||
|
color = ''
|
||||||
fmt = '\t' + color + '{0.hostname} capacity={0.capacity} version={1}'
|
fmt = '\t' + color + '{0.hostname} capacity={0.capacity} version={1}'
|
||||||
if x.capacity:
|
if x.capacity:
|
||||||
fmt += ' heartbeat="{0.modified:%Y-%m-%d %H:%M:%S}"'
|
fmt += ' heartbeat="{0.modified:%Y-%m-%d %H:%M:%S}"'
|
||||||
|
|||||||
Reference in New Issue
Block a user