Skip to content

Commit

Permalink
Fix ignoring --no-color for awx-manage list_instances command
Browse files Browse the repository at this point in the history
  • Loading branch information
oweel committed Jul 21, 2021
1 parent c9259ac commit e7f1d1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions awx/main/management/commands/list_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -44,6 +45,8 @@ def handle(self, *args, **options):
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}"'
Expand Down

0 comments on commit e7f1d1d

Please sign in to comment.