mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 10:11:05 -03:30
Add an HA list_instances management command
This commit is contained in:
19
awx/main/management/commands/list_instances.py
Normal file
19
awx/main/management/commands/list_instances.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Copyright (c) 2014 Ansible, Inc.
|
||||
# All Rights Reserved
|
||||
|
||||
from optparse import make_option
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from awx.main.models import Instance
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""List instances from the Tower database
|
||||
"""
|
||||
|
||||
def handle(self, **options):
|
||||
for instance in Instance.objects.all():
|
||||
print("uuid: %s; hostname: %s; primary: %s; created: %s; modified: %s" %
|
||||
(instance.uuid, instance.hostname, instance.primary, instance.created, instance.modified))
|
||||
Reference in New Issue
Block a user