From e7f1d1d0c12f4242c11e5638ea669aa84e515930 Mon Sep 17 00:00:00 2001 From: Alexander Komarov Date: Mon, 19 Jul 2021 12:52:29 +0500 Subject: [PATCH] Fix ignoring --no-color for awx-manage list_instances command --- awx/main/management/commands/list_instances.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/awx/main/management/commands/list_instances.py b/awx/main/management/commands/list_instances.py index 473f0e379e..7568f0b45c 100644 --- a/awx/main/management/commands/list_instances.py +++ b/awx/main/management/commands/list_instances.py @@ -25,6 +25,7 @@ class Command(BaseCommand): def handle(self, *args, **options): super(Command, self).__init__() + no_color = options.get("no_color", False) groups = list(InstanceGroup.objects.all()) ungrouped = Ungrouped() @@ -44,6 +45,8 @@ class Command(BaseCommand): color = '\033[91m' if x.enabled is False: color = '\033[90m[DISABLED] ' + if no_color: + color = '' fmt = '\t' + color + '{0.hostname} capacity={0.capacity} version={1}' if x.capacity: fmt += ' heartbeat="{0.modified:%Y-%m-%d %H:%M:%S}"'