summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/library
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-01-26 14:51:54 -0500
committerKenny Woodson <kwoodson@redhat.com>2017-01-26 14:51:54 -0500
commit82634f8920e912a9cf567065a2da4cf20faeccbc (patch)
treece4efb686eae3ac2cc1476275ee9b72e885487fc /roles/lib_openshift/library
parent1e7bd9bf98531d7a6666937df54484641bfe3a15 (diff)
downloadopenshift-82634f8920e912a9cf567065a2da4cf20faeccbc.tar.gz
openshift-82634f8920e912a9cf567065a2da4cf20faeccbc.tar.bz2
openshift-82634f8920e912a9cf567065a2da4cf20faeccbc.tar.xz
openshift-82634f8920e912a9cf567065a2da4cf20faeccbc.zip
Fixing linters.
Diffstat (limited to 'roles/lib_openshift/library')
-rw-r--r--roles/lib_openshift/library/oadm_manage_node.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/roles/lib_openshift/library/oadm_manage_node.py b/roles/lib_openshift/library/oadm_manage_node.py
index 39e6384da..1d2b70885 100644
--- a/roles/lib_openshift/library/oadm_manage_node.py
+++ b/roles/lib_openshift/library/oadm_manage_node.py
@@ -1285,7 +1285,7 @@ class ManageNode(OpenShiftCLI):
_node = {}
_node['name'] = node['metadata']['name']
_node['schedulable'] = True
- if node['spec'].has_key('unschedulable'):
+ if 'unschedulable' in node['spec']:
_node['schedulable'] = False
nodes.append(_node)
@@ -1363,9 +1363,9 @@ class ManageNode(OpenShiftCLI):
# This is a short circuit based on the way we fetch nodes.
# If node is a dict/list then we've already fetched them.
for node in nodes:
- if isinstance(node, dict) and node.has_key('returncode'):
+ if isinstance(node, dict) and 'returncode' in node:
return {'results': nodes, 'returncode': node['returncode']}
- if isinstance(node, list) and node[0].has_key('returncode'):
+ if isinstance(node, list) and 'returncode' in node[0]:
return {'results': nodes, 'returncode': node[0]['returncode']}
# check all the nodes that were returned and verify they are:
# node['schedulable'] == self.config.config_options['schedulable']['value']
@@ -1382,7 +1382,7 @@ class ManageNode(OpenShiftCLI):
# removing header line and trailing new line character of node lines
for node_results in results['results'].split('\n')[1:-1]:
parts = node_results.split()
- nodes.append({'name': parts[0], 'schedulable': 'Ready' == parts[1]})
+ nodes.append({'name': parts[0], 'schedulable': parts[1] == 'Ready'})
results['nodes'] = nodes
return results
@@ -1414,8 +1414,12 @@ class ManageNode(OpenShiftCLI):
results = None
changed = False
if params['schedulable'] != None:
+ if check_mode:
+ # schedulable returns results after the fact.
+ # We need to redo how this works to support check_mode completely.
+ return {'changed': True, 'msg': 'CHECK_MODE: would have called schedulable.'}
results = oadm_mn.schedulable()
- if not results.has_key('changed'):
+ if 'changed' not in results:
changed = True
if params['evacuate']: