'oadm manage-node call for making nodes unschedulable'

def schedulable(self):

    nodes = self.config.config_options['node']['value']
    selector = self.config.config_options['selector']['value']
    if (not nodes):
        nodes = self.get_nodes(selector=selector)
    else:
        tmp_nodes = []
        for name in nodes:
            tmp_result = self.get_nodes(name)
            if isinstance(tmp_result, dict):
                tmp_nodes.append(tmp_result)
                continue
            tmp_nodes.extend(tmp_result)
        nodes = tmp_nodes
    for node in nodes:
        if (isinstance(node, dict) and ('returncode' in node)):
            return {'results': nodes, 'returncode': node['returncode']}
        if (isinstance(node, list) and ('returncode' in node[0])):
            return {'results': nodes, 'returncode': node[0]['returncode']}
    if any([(node['schedulable'] != self.config.config_options['schedulable']['value']) for node in nodes]):
        results = self._schedulable(node=self.config.config_options['node']['value'], selector=self.config.config_options['selector']['value'], schedulable=self.config.config_options['schedulable']['value'])
        if results['results'].startswith('NAME'):
            nodes = []
            for node_results in results['results'].split('\n')[1:(-1)]:
                parts = node_results.split()
                nodes.append({'name': parts[0], 'schedulable': (parts[1] == 'Ready')})
            results['nodes'] = nodes
        return results
    results = {}
    results['returncode'] = 0
    results['changed'] = False
    results['nodes'] = nodes
    return results
