summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenShift Bot <dmcphers+openshiftbot@redhat.com>2017-03-16 18:43:36 -0400
committerGitHub <noreply@github.com>2017-03-16 18:43:36 -0400
commitbf69e6ac42b15f033016051270723b5990d956f0 (patch)
treef0ed00f75bf167f47e832149bfcb4d758c1c60f7
parent132c4a48d4724d21486e36fae616dce38410a2a7 (diff)
parent7fbc356ec6896e441f2423bd3168ff231b4a8bb2 (diff)
downloadopenshift-bf69e6ac42b15f033016051270723b5990d956f0.tar.gz
openshift-bf69e6ac42b15f033016051270723b5990d956f0.tar.bz2
openshift-bf69e6ac42b15f033016051270723b5990d956f0.tar.xz
openshift-bf69e6ac42b15f033016051270723b5990d956f0.zip
Merge pull request #3671 from abutcher/router-nodes
Merged by openshift-bot
-rw-r--r--roles/openshift_hosted/filter_plugins/filters.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/roles/openshift_hosted/filter_plugins/filters.py b/roles/openshift_hosted/filter_plugins/filters.py
index cbfadfe9d..7f41529ac 100644
--- a/roles/openshift_hosted/filter_plugins/filters.py
+++ b/roles/openshift_hosted/filter_plugins/filters.py
@@ -21,14 +21,21 @@ class FilterModule(object):
if replicas is not None:
return replicas
+ replicas = 1
+
+ # Ignore boolean expression limit of 5.
+ # pylint: disable=too-many-boolean-expressions
if (isinstance(router_nodes, dict) and
'results' in router_nodes and
'results' in router_nodes['results'] and
- 'items' in router_nodes['results']['results']):
+ isinstance(router_nodes['results']['results'], list) and
+ len(router_nodes['results']['results']) > 0 and
+ 'items' in router_nodes['results']['results'][0]):
- return len(router_nodes['results']['results'][0]['items'])
+ if len(router_nodes['results']['results'][0]['items']) > 0:
+ replicas = len(router_nodes['results']['results'][0]['items'])
- return 1
+ return replicas
def filters(self):
''' returns a mapping of filters to methods '''