diff options
author | Patrick Uiterwijk <puiterwijk@redhat.com> | 2016-06-06 09:25:55 +0000 |
---|---|---|
committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2016-06-06 09:25:57 +0000 |
commit | 4387e0530ab5fd51fcb6f3a69a07f79a107d1bd3 (patch) | |
tree | ff85fb56e25fb475775b8a0ba4820cb0a09514da | |
parent | 14cfa4903999289cbc49a934eed07fdebc11513c (diff) | |
download | ansible-4387e0530ab5fd51fcb6f3a69a07f79a107d1bd3.tar.gz ansible-4387e0530ab5fd51fcb6f3a69a07f79a107d1bd3.tar.xz ansible-4387e0530ab5fd51fcb6f3a69a07f79a107d1bd3.zip |
Fix OpenShift key sync
Turns out the used library only works with a specific API version
but it didn't specify that unless the user tells it to.
This pins us on openshift API 1.5 until support for that is dropped.
This also fixes the issue where we pass the key arguments as keyword
arguments but the key_add function did not expect them as such.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
-rw-r--r-- | roles/batcave/files/oshift_mod.py | 2 | ||||
-rwxr-xr-x | roles/batcave/files/sync-openshift-keys.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/roles/batcave/files/oshift_mod.py b/roles/batcave/files/oshift_mod.py index 592908bc5..b3057e4cb 100644 --- a/roles/batcave/files/oshift_mod.py +++ b/roles/batcave/files/oshift_mod.py @@ -282,7 +282,7 @@ class Openshift(object): return (status, raw_response) @conditional_decorator(timeit, DOING_PERFORMANCE_ANALYSIS) - def key_add(self, kwargs): + def key_add(self, **kwargs): """ params: {name, type, key_path} """ diff --git a/roles/batcave/files/sync-openshift-keys.py b/roles/batcave/files/sync-openshift-keys.py index 182ce9433..47c0141dc 100755 --- a/roles/batcave/files/sync-openshift-keys.py +++ b/roles/batcave/files/sync-openshift-keys.py @@ -8,6 +8,9 @@ from argparse import ArgumentParser from fedora.client import AccountSystem from oshift_mod import Openshift from getpass import getpass +import os + +os.environ['OPENSHIFT_REST_API'] = '1.5' def get_keys(host,user,passwd): os = Openshift(host=host,user=user,passwd=passwd) |