From f25bf23558be69f9e22f029eec21aabdf8cc2a67 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Wed, 21 Sep 2016 11:49:12 -0500 Subject: [PATCH] Human readable logs should be removed Whle the human readable logging functionality is nice for debug purposes it has little to no value in general deployments and in slows Ansible runs down considerably. In my opinion, this plugin should be removed. If this is a desirable feature for an individual deployer they can pull the plugin into their stack outside of OSA. Change-Id: Ie07eefe8ffe2036815bc89d129862f105b9ff566 Signed-off-by: Kevin Carter --- callback/human_log.py | 55 ------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 callback/human_log.py diff --git a/callback/human_log.py b/callback/human_log.py deleted file mode 100644 index c37f457c..00000000 --- a/callback/human_log.py +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2016, Rackspace US, Inc. -# -# 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 os -import sys - -from distutils.version import LooseVersion -from ansible import __version__ as __ansible_version__ - -import requests - -# This appends the sys path with the file path which is used for the -# import of the specific verion of the config_template action plugin -# needed based on the ansible version calling the plugin. -DIRPATH = os.path.dirname(__file__) - -# NOTICE: These plugins are developed outside of OSA and can not be -# added to the main repository due to GPL conflicts in OpenStack. -PLUGINS = { - 'v1': 'https://gist.githubusercontent.com/cliffano/9868180/raw/' - 'f32b76560b7c72cdc44e6aa0e9f46d0392f54a43/human_log.py', - 'v2': 'https://raw.githubusercontent.com/rdo-infra/weirdo/master/' - 'playbooks/library/human_log.py' -} - -if DIRPATH not in sys.path: - sys.path.append(DIRPATH) - -def get_plugin(plugin, name): - req = requests.get(plugin, stream=True) - if req.status_code == 200: - with open(os.path.join(DIRPATH, name), 'wb') as f: - for chunk in req.iter_content(1024): - f.write(chunk) - return True - else: - return False - -if LooseVersion(__ansible_version__) < LooseVersion("2.0"): - if get_plugin(plugin=PLUGINS['v1'], name='_v1_human_log.py'): - from _v1_human_log import * -else: - if get_plugin(plugin=PLUGINS['v2'], name='_v2_human_log.py'): - from _v2_human_log import *