diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2017-02-08 14:00:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-08 14:00:40 -0500 |
commit | 5c6dc36dda1e2ef87f4e43c77e682d829a6bbd3c (patch) | |
tree | a125b174d8cf2b659a49e70037c72115c98d63a1 /roles/lib_openshift/src/ansible/oc_route.py | |
parent | 405bd70f0f94f4a45cb4b7cfc7634a82928b6b2e (diff) | |
parent | 28e64664e55c69eaa0a7d87933e1a702cd7ebac7 (diff) | |
download | openshift-5c6dc36dda1e2ef87f4e43c77e682d829a6bbd3c.tar.gz openshift-5c6dc36dda1e2ef87f4e43c77e682d829a6bbd3c.tar.bz2 openshift-5c6dc36dda1e2ef87f4e43c77e682d829a6bbd3c.tar.xz openshift-5c6dc36dda1e2ef87f4e43c77e682d829a6bbd3c.zip |
Merge pull request #3283 from kwoodson/router_port
Adding test cases. Adding support for specifying port on route.
Diffstat (limited to 'roles/lib_openshift/src/ansible/oc_route.py')
-rw-r--r-- | roles/lib_openshift/src/ansible/oc_route.py | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/roles/lib_openshift/src/ansible/oc_route.py b/roles/lib_openshift/src/ansible/oc_route.py index c87e6738f..f2f5c5095 100644 --- a/roles/lib_openshift/src/ansible/oc_route.py +++ b/roles/lib_openshift/src/ansible/oc_route.py @@ -2,20 +2,6 @@ # flake8: noqa -def get_cert_data(path, content): - '''get the data for a particular value''' - if not path and not content: - return None - - rval = None - if path and os.path.exists(path) and os.access(path, os.R_OK): - rval = open(path).read() - elif content: - rval = content - - return rval - - # pylint: disable=too-many-branches def main(): ''' @@ -42,6 +28,7 @@ def main(): host=dict(default=None, type='str'), wildcard_policy=dict(default=None, type='str'), weight=dict(default=None, type='int'), + port=dict(default=None, type='int'), ), mutually_exclusive=[('dest_cacert_path', 'dest_cacert_content'), ('cacert_path', 'cacert_content'), @@ -49,30 +36,8 @@ def main(): ('key_path', 'key_content'), ], supports_check_mode=True, ) - files = {'destcacert': {'path': module.params['dest_cacert_path'], - 'content': module.params['dest_cacert_content'], - 'value': None, }, - 'cacert': {'path': module.params['cacert_path'], - 'content': module.params['cacert_content'], - 'value': None, }, - 'cert': {'path': module.params['cert_path'], - 'content': module.params['cert_content'], - 'value': None, }, - 'key': {'path': module.params['key_path'], - 'content': module.params['key_content'], - 'value': None, }, } - - if module.params['tls_termination']: - for key, option in files.items(): - if key == 'destcacert' and module.params['tls_termination'] != 'reencrypt': - continue - - option['value'] = get_cert_data(option['path'], option['content']) - - if not option['value']: - module.fail_json(msg='Verify that you pass a value for %s' % key) - results = OCRoute.run_ansible(module.params, files, module.check_mode) + results = OCRoute.run_ansible(module.params, module.check_mode) if 'failed' in results: module.fail_json(**results) |