summaryrefslogtreecommitdiffstats
path: root/lookup_plugins/oo_option.py
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2017-09-30 14:14:18 -0700
committerGitHub <noreply@github.com>2017-09-30 14:14:18 -0700
commit62cb2a8d573928cb54a7d0ba475d61a6b65e0307 (patch)
tree74dc3c17224fe6d2b3bd4dfffc521e348c74eeb8 /lookup_plugins/oo_option.py
parent99c3117df11f1d6b5240dc72f57b2f7f541a234a (diff)
parentb649749bac0a086199820f91f85fe42ba99f206e (diff)
downloadopenshift-62cb2a8d573928cb54a7d0ba475d61a6b65e0307.tar.gz
openshift-62cb2a8d573928cb54a7d0ba475d61a6b65e0307.tar.bz2
openshift-62cb2a8d573928cb54a7d0ba475d61a6b65e0307.tar.xz
openshift-62cb2a8d573928cb54a7d0ba475d61a6b65e0307.zip
Merge pull request #5449 from abutcher/wildcard-router-cert-redeploy
Automatic merge from submit-queue. Bug 1490186: Router pod not running after router certificates redeployment This carries https://github.com/openshift/openshift-ansible/pull/5417. More of the router cert redeploy logic could be moved into the `openshift_hosted` role with a flag. I may pull those over. https://bugzilla.redhat.com/show_bug.cgi?id=1490186
Diffstat (limited to 'lookup_plugins/oo_option.py')
-rw-r--r--lookup_plugins/oo_option.py74
1 files changed, 0 insertions, 74 deletions
diff --git a/lookup_plugins/oo_option.py b/lookup_plugins/oo_option.py
deleted file mode 100644
index 4581cb6b8..000000000
--- a/lookup_plugins/oo_option.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python2
-# -*- coding: utf-8 -*-
-'''
-oo_option lookup plugin for openshift-ansible
-
-Usage:
-
- - debug:
- msg: "{{ lookup('oo_option', '<key>') | default('<default_value>', True) }}"
-
-This returns, by order of priority:
-
-* if it exists, the `cli_<key>` ansible variable. This variable is set by `bin/cluster --option <key>=<value> …`
-* if it exists, the envirnoment variable named `<key>`
-* if none of the above conditions are met, empty string is returned
-'''
-
-
-import os
-
-# pylint: disable=no-name-in-module,import-error,unused-argument,unused-variable,super-init-not-called,too-few-public-methods,missing-docstring
-try:
- # ansible-2.0
- from ansible.plugins.lookup import LookupBase
-except ImportError:
- # ansible-1.9.x
- class LookupBase(object):
- def __init__(self, basedir=None, runner=None, **kwargs):
- self.runner = runner
- self.basedir = self.runner.basedir
-
- def get_basedir(self, variables):
- return self.basedir
-
-
-# Reason: disable too-few-public-methods because the `run` method is the only
-# one required by the Ansible API
-# Status: permanently disabled
-# pylint: disable=too-few-public-methods
-class LookupModule(LookupBase):
- ''' oo_option lookup plugin main class '''
-
- # Reason: disable unused-argument because Ansible is calling us with many
- # parameters we are not interested in.
- # The lookup plugins of Ansible have this kwargs “catch-all” parameter
- # which is not used
- # Status: permanently disabled unless Ansible API evolves
- # pylint: disable=unused-argument
- def __init__(self, basedir=None, **kwargs):
- ''' Constructor '''
- self.basedir = basedir
-
- # Reason: disable unused-argument because Ansible is calling us with many
- # parameters we are not interested in.
- # The lookup plugins of Ansible have this kwargs “catch-all” parameter
- # which is not used
- # Status: permanently disabled unless Ansible API evolves
- # pylint: disable=unused-argument
- def run(self, terms, variables, **kwargs):
- ''' Main execution path '''
-
- ret = []
-
- for term in terms:
- option_name = term.split()[0]
- cli_key = 'cli_' + option_name
- if 'vars' in variables and cli_key in variables['vars']:
- ret.append(variables['vars'][cli_key])
- elif option_name in os.environ:
- ret.append(os.environ[option_name])
- else:
- ret.append('')
-
- return ret