From 315657e7befc62502e446dd889f96cfa4c0f5458 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Thu, 23 Feb 2017 11:34:05 -0500 Subject: Fixed default variables. Added a fix to generated secret in env var. --- roles/lib_openshift/library/oc_env.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'roles/lib_openshift/library/oc_env.py') diff --git a/roles/lib_openshift/library/oc_env.py b/roles/lib_openshift/library/oc_env.py index 3286985c5..684d0f626 100644 --- a/roles/lib_openshift/library/oc_env.py +++ b/roles/lib_openshift/library/oc_env.py @@ -1546,6 +1546,18 @@ spec: return None + def get_env_var(self, key): + '''return a environment variables ''' + results = self.get(DeploymentConfig.env_path) or [] + if not results: + return None + + for env_var in results: + if env_var['name'] == key: + return env_var + + return None + def get_replicas(self): ''' return replicas setting ''' return self.get(DeploymentConfig.replicas_path) -- cgit v1.2.3 From 51dd7e556b3dafab88b571b370ecbfc99bcd0ae0 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Fri, 24 Feb 2017 11:50:33 -0500 Subject: Adding get_env_var to deploymentconfig. --- roles/lib_openshift/library/oc_env.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'roles/lib_openshift/library/oc_env.py') diff --git a/roles/lib_openshift/library/oc_env.py b/roles/lib_openshift/library/oc_env.py index 684d0f626..db24ef71f 100644 --- a/roles/lib_openshift/library/oc_env.py +++ b/roles/lib_openshift/library/oc_env.py @@ -1462,6 +1462,18 @@ spec: return False + def get_env_var(self, key): + '''return a environment variables ''' + results = self.get(DeploymentConfig.env_path) or [] + if not results: + return None + + for env_var in results: + if env_var['name'] == key: + return env_var + + return None + def get_env_vars(self): '''return a environment variables ''' return self.get(DeploymentConfig.env_path) or [] @@ -1546,18 +1558,6 @@ spec: return None - def get_env_var(self, key): - '''return a environment variables ''' - results = self.get(DeploymentConfig.env_path) or [] - if not results: - return None - - for env_var in results: - if env_var['name'] == key: - return env_var - - return None - def get_replicas(self): ''' return replicas setting ''' return self.get(DeploymentConfig.replicas_path) -- cgit v1.2.3 From 1e3b9869a349ccdd8a72c796861a0b257880cf88 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Fri, 24 Feb 2017 13:29:01 -0500 Subject: Rebased. --- roles/lib_openshift/library/oc_env.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles/lib_openshift/library/oc_env.py') diff --git a/roles/lib_openshift/library/oc_env.py b/roles/lib_openshift/library/oc_env.py index db24ef71f..a84b9f074 100644 --- a/roles/lib_openshift/library/oc_env.py +++ b/roles/lib_openshift/library/oc_env.py @@ -1466,7 +1466,7 @@ spec: '''return a environment variables ''' results = self.get(DeploymentConfig.env_path) or [] if not results: - return None + return None for env_var in results: if env_var['name'] == key: -- cgit v1.2.3