diff options
| author | Mark Goddard <mark@stackhpc.com> | 2020-03-25 17:25:36 +0000 |
|---|---|---|
| committer | Radosław Piliszek <radoslaw.piliszek@gmail.com> | 2020-04-04 14:16:58 +0000 |
| commit | 0f95bf43730c6ec0e6fc1cf7d07e81b44eff0600 (patch) | |
| tree | ce1d645976d46c02e0bbec69812bce7f62c13b22 /docker | |
| parent | 69f74554671a49c75bebeeed9d83816ffbd7efec (diff) | |
| download | kolla-0f95bf43730c6ec0e6fc1cf7d07e81b44eff0600.tar.gz kolla-0f95bf43730c6ec0e6fc1cf7d07e81b44eff0600.zip | |
Remove unused script rabbitmq_get_gospel_node.py
This script is used by neither Kolla Ansible nor TripleO.
Change-Id: I4859a727b269dd13465d90dff50107e29d39956e
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/rabbitmq/Dockerfile.j2 | 3 | ||||
| -rw-r--r-- | docker/rabbitmq/rabbitmq_get_gospel_node.py | 63 |
2 files changed, 1 insertions, 65 deletions
diff --git a/docker/rabbitmq/Dockerfile.j2 b/docker/rabbitmq/Dockerfile.j2 index 493f4c2f7..046cb9b3c 100644 --- a/docker/rabbitmq/Dockerfile.j2 +++ b/docker/rabbitmq/Dockerfile.j2 @@ -73,8 +73,7 @@ RUN rm -rf /var/lib/rabbitmq/* \ {% endblock %} COPY extend_start.sh /usr/local/bin/kolla_extend_start -COPY rabbitmq_get_gospel_node.py /usr/local/bin/rabbitmq_get_gospel_node -RUN chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/rabbitmq_get_gospel_node +RUN chmod 755 /usr/local/bin/kolla_extend_start {% block rabbitmq_footer %}{% endblock %} {% block footer %}{% endblock %} diff --git a/docker/rabbitmq/rabbitmq_get_gospel_node.py b/docker/rabbitmq/rabbitmq_get_gospel_node.py deleted file mode 100644 index 9f40c92ac..000000000 --- a/docker/rabbitmq/rabbitmq_get_gospel_node.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/python - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import json -import subprocess # nosec -import traceback - - -def extract_gospel_node(term): - return term.split("@")[1].translate(None, "\'\"{},") - - -def main(): - try: - # TODO(pbourke): see if can get gospel node without requiring shell - raw_status = subprocess.check_output( - "/usr/sbin/rabbitmqctl eval 'rabbit_clusterer:status().'", - shell=True, stderr=subprocess.STDOUT # nosec: this command appears - # to require a shell to work - ) - if "Rabbit is running in cluster configuration" not in raw_status: - raise AttributeError - gospel_line = [ - line for line in raw_status.split('\n') if 'gospel' in line - ][0] - gospel_node = extract_gospel_node(gospel_line) - if not gospel_node: - raise AttributeError - except AttributeError: - result = { - 'failed': True, - 'error': raw_status, - 'changed': True - } - except Exception: - result = { - 'failed': True, - 'error': traceback.format_exc(), - 'changed': True - } - else: - result = { - 'failed': False, - 'hostname': gospel_node, - 'changed': False - } - - print(json.dumps(result)) - - -if __name__ == '__main__': - main() |
