remove a bunch of RabbitMQ references

This commit is contained in:
Ryan Petrello
2020-03-24 18:34:20 -04:00
parent bd7c048113
commit 8f1db173c1
10 changed files with 11 additions and 83 deletions

View File

@@ -1,8 +1,6 @@
# Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved
import subprocess
from django.db import transaction
from django.core.management.base import BaseCommand, CommandError
@@ -33,18 +31,9 @@ class Command(BaseCommand):
with advisory_lock('instance_registration_%s' % hostname):
instance = Instance.objects.filter(hostname=hostname)
if instance.exists():
isolated = instance.first().is_isolated()
instance.delete()
print("Instance Removed")
if isolated:
print('Successfully deprovisioned {}'.format(hostname))
else:
result = subprocess.Popen("rabbitmqctl forget_cluster_node rabbitmq@{}".format(hostname), shell=True).wait()
if result != 0:
print("Node deprovisioning may have failed when attempting to "
"remove the RabbitMQ instance {} from the cluster".format(hostname))
else:
print('Successfully deprovisioned {}'.format(hostname))
print('Successfully deprovisioned {}'.format(hostname))
print('(changed: True)')
else:
print('No instance found matching name {}'.format(hostname))

View File

@@ -126,10 +126,8 @@ def test_send_notifications_list(mock_notifications_filter, mock_job_get, mocker
@pytest.mark.parametrize("key,value", [
('REST_API_TOKEN', 'SECRET'),
('SECRET_KEY', 'SECRET'),
('RABBITMQ_PASS', 'SECRET'),
('VMWARE_PASSWORD', 'SECRET'),
('API_SECRET', 'SECRET'),
('CALLBACK_CONNECTION', 'amqp://tower:password@localhost:5672/tower'),
('ANSIBLE_GALAXY_SERVER_PRIMARY_GALAXY_PASSWORD', 'SECRET'),
('ANSIBLE_GALAXY_SERVER_PRIMARY_GALAXY_TOKEN', 'SECRET'),
])

View File

@@ -102,10 +102,6 @@
"INVENTORY_ID": "1",
"MAX_EVENT_RES": "700000",
"PROOT_TMP_DIR": "/tmp",
"RABBITMQ_HOST": "rabbitmq",
"RABBITMQ_PASS": "guest",
"RABBITMQ_USER": "guest",
"RABBITMQ_VHOST": "/",
"ANSIBLE_LIBRARY": "/awx_devel/awx/plugins/library",
"SDB_NOTIFY_HOST": "docker.for.mac.host.internal",
"AWX_GROUP_QUEUES": "tower",

View File

@@ -102,10 +102,6 @@
"INVENTORY_ID": "1",
"MAX_EVENT_RES": "700000",
"PROOT_TMP_DIR": "/tmp",
"RABBITMQ_HOST": "rabbitmq",
"RABBITMQ_PASS": "guest",
"RABBITMQ_USER": "guest",
"RABBITMQ_VHOST": "/",
"ANSIBLE_LIBRARY": "/awx_devel/awx/plugins/library",
"SDB_NOTIFY_HOST": "docker.for.mac.host.internal",
"AWX_GROUP_QUEUES": "tower",

View File

@@ -121,16 +121,13 @@
"job_env": {
"HOSTNAME": "awx",
"MAKEFLAGS": "w",
"RABBITMQ_USER": "guest",
"OS": "Operating System: Docker for Mac",
"LC_ALL": "en_US.UTF-8",
"RABBITMQ_VHOST": "/",
"SDB_HOST": "0.0.0.0",
"MAKELEVEL": "2",
"VIRTUAL_ENV": "/venv/ansible",
"MFLAGS": "-w",
"PATH": "/venv/ansible/bin:/venv/awx/bin:/venv/awx/bin:/usr/local/n/versions/node/10.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"RABBITMQ_PASS": "**********",
"SUPERVISOR_GROUP_NAME": "tower-processes",
"PWD": "/awx_devel",
"LANG": "\"en-us\"",
@@ -142,7 +139,6 @@
"AWX_GROUP_QUEUES": "tower",
"SUPERVISOR_SERVER_URL": "unix:///tmp/supervisor.sock",
"SUPERVISOR_PROCESS_NAME": "awx-dispatcher",
"RABBITMQ_HOST": "rabbitmq",
"CURRENT_UID": "501",
"_": "/venv/awx/bin/python3",
"DJANGO_SETTINGS_MODULE": "awx.settings.development",
@@ -191,4 +187,4 @@
"task_count": 1
},
"custom_virtualenv": "/venv/ansible"
}
}