mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 00:38:45 -03:30
remove a few deprecated awx-manage commands
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
# All Rights Reserved
|
# All Rights Reserved
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import warnings
|
|
||||||
|
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from django.core.management.base import BaseCommand, CommandError
|
from django.core.management.base import BaseCommand, CommandError
|
||||||
@@ -24,17 +23,10 @@ class Command(BaseCommand):
|
|||||||
def add_arguments(self, parser):
|
def add_arguments(self, parser):
|
||||||
parser.add_argument('--hostname', dest='hostname', type=str,
|
parser.add_argument('--hostname', dest='hostname', type=str,
|
||||||
help='Hostname used during provisioning')
|
help='Hostname used during provisioning')
|
||||||
parser.add_argument('--name', dest='name', type=str,
|
|
||||||
help='(PENDING DEPRECIATION) Hostname used during provisioning')
|
|
||||||
|
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
# TODO: remove in 3.3
|
# TODO: remove in 3.3
|
||||||
if options.get('name'):
|
|
||||||
warnings.warn("`--name` is depreciated in favor of `--hostname`, and will be removed in release 3.3.")
|
|
||||||
if options.get('hostname'):
|
|
||||||
raise CommandError("Cannot accept both --name and --hostname.")
|
|
||||||
options['hostname'] = options['name']
|
|
||||||
hostname = options.get('hostname')
|
hostname = options.get('hostname')
|
||||||
if not hostname:
|
if not hostname:
|
||||||
raise CommandError("--hostname is a required argument")
|
raise CommandError("--hostname is a required argument")
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
# Copyright (c) 2017 Ansible by Red Hat
|
|
||||||
# All Rights Reserved
|
|
||||||
|
|
||||||
# Borrow from another AWX command
|
|
||||||
from awx.main.management.commands.deprovision_instance import Command as OtherCommand
|
|
||||||
|
|
||||||
# Python
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
|
|
||||||
class Command(OtherCommand):
|
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
|
||||||
# TODO: delete this entire file in 3.3
|
|
||||||
warnings.warn('This command is replaced with `deprovision_instance` and will '
|
|
||||||
'be removed in release 3.3.')
|
|
||||||
return super(Command, self).handle(*args, **options)
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
# Copyright (c) 2017 Ansible by Red Hat
|
|
||||||
# All Rights Reserved
|
|
||||||
|
|
||||||
# Borrow from another AWX command
|
|
||||||
from awx.main.management.commands.provision_instance import Command as OtherCommand
|
|
||||||
|
|
||||||
# Python
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
|
|
||||||
class Command(OtherCommand):
|
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
|
||||||
# TODO: delete this entire file in 3.3
|
|
||||||
warnings.warn('This command is replaced with `provision_instance` and will '
|
|
||||||
'be removed in release 3.3.')
|
|
||||||
return super(Command, self).handle(*args, **options)
|
|
||||||
Reference in New Issue
Block a user