From 2f8a7de6bd55cd396b4b2948a7d63ccfa9a7b545 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Mon, 31 Jul 2017 16:42:10 -0400 Subject: [PATCH] remove --hostnames option for registering nodes --- awx/main/management/commands/register_instance.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/awx/main/management/commands/register_instance.py b/awx/main/management/commands/register_instance.py index 9cf28a95b8..98831dfb52 100644 --- a/awx/main/management/commands/register_instance.py +++ b/awx/main/management/commands/register_instance.py @@ -7,7 +7,7 @@ from django.conf import settings from optparse import make_option from django.db import transaction -from django.core.management.base import BaseCommand +from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): @@ -19,9 +19,6 @@ class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--hostname', dest='hostname', type='string', help='Hostname used during provisioning'), - make_option('--hostnames', dest='hostnames', type='string', - help='Alternatively hostnames can be provided with ' - 'this option as a comma-Delimited list'), ) def _register_hostname(self, hostname): @@ -39,14 +36,10 @@ class Command(BaseCommand): @transaction.atomic def handle(self, **options): + if not options.get('hostname'): + raise CommandError("Specify `--hostname` to use this command.") self.uuid = settings.SYSTEM_UUID self.changed = False self._register_hostname(options.get('hostname')) - hostname_list = [] - if options.get('hostnames'): - hostname_list = options.get('hostnames').split(",") - instance_list = [x.strip() for x in hostname_list if x] - for inst_name in instance_list: - self._register_hostname(inst_name) if self.changed: print('(changed: True)')