summaryrefslogtreecommitdiffstats
path: root/filter_plugins
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@redhat.com>2016-05-20 17:15:53 -0400
committerAndrew Butcher <abutcher@redhat.com>2016-05-23 14:59:30 -0400
commitc625a47a85bdb895efaf05567f075f3cad5eee3c (patch)
tree20f492bbfc006bec3bcc2ecce5d583f420f16843 /filter_plugins
parent6c86bd94b01a1d200fca865996c16a95ccaa7183 (diff)
downloadopenshift-c625a47a85bdb895efaf05567f075f3cad5eee3c.tar.gz
openshift-c625a47a85bdb895efaf05567f075f3cad5eee3c.tar.bz2
openshift-c625a47a85bdb895efaf05567f075f3cad5eee3c.tar.xz
openshift-c625a47a85bdb895efaf05567f075f3cad5eee3c.zip
Allow multiple login providers post 3.2.
Diffstat (limited to 'filter_plugins')
-rw-r--r--filter_plugins/openshift_master.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/filter_plugins/openshift_master.py b/filter_plugins/openshift_master.py
index bb2f5ba7a..0af47fb62 100644
--- a/filter_plugins/openshift_master.py
+++ b/filter_plugins/openshift_master.py
@@ -9,6 +9,7 @@ import sys
import yaml
from ansible import errors
+from distutils.version import LooseVersion
# pylint: disable=no-name-in-module,import-error
try:
@@ -77,10 +78,10 @@ class IdentityProviderBase(object):
self._allow_additional = True
@staticmethod
- def validate_idp_list(idp_list):
+ def validate_idp_list(idp_list, openshift_version):
''' validates a list of idps '''
login_providers = [x.name for x in idp_list if x.login]
- if len(login_providers) > 1:
+ if len(login_providers) > 1 and LooseVersion(openshift_version) < LooseVersion('3.2'):
raise errors.AnsibleFilterError("|failed multiple providers are "
"not allowed for login. login "
"providers: {0}".format(', '.join(login_providers)))
@@ -461,7 +462,7 @@ class FilterModule(object):
''' Custom ansible filters for use by the openshift_master role'''
@staticmethod
- def translate_idps(idps, api_version):
+ def translate_idps(idps, api_version, openshift_version):
''' Translates a list of dictionaries into a valid identityProviders config '''
idp_list = []
@@ -478,7 +479,7 @@ class FilterModule(object):
idp_list.append(idp_inst)
- IdentityProviderBase.validate_idp_list(idp_list)
+ IdentityProviderBase.validate_idp_list(idp_list, openshift_version)
return yaml.safe_dump([idp.to_dict() for idp in idp_list], default_flow_style=False)
@staticmethod