def get_kube_nodes(args):
    ' gets all nodes  '
    if args.dry_run:
        return []
    cmd = (utils.kubectl_cmd(args) + ['get', 'nodes', '-ojson'])
    try:
        resp = utils.execute(cmd)
        data = json.loads(resp.stdout)
        nodes = []
        for nodedata in data['items']:
            nodes.append(nodedata['metadata']['name'])
        print(('The following nodes are available:\n  %s' % ', '.join(nodes)))
        print()
        return nodes
    except utils.CommandError as err:
        utils.command_error(cmd, err.stderr)
    except FileNotFoundError:
        utils.kubectl_cmd_help(args.kubectl_cmd)
gets all nodes
def get_kube_nodes(args):
    '   '
    if args.dry_run:
        return []
    cmd = (utils.kubectl_cmd(args) + ['get', 'nodes', '-ojson'])
    try:
        resp = utils.execute(cmd)
        data = json.loads(resp.stdout)
        nodes = []
        for nodedata in data['items']:
            nodes.append(nodedata['metadata']['name'])
        print(('The following nodes are available:\n  %s' % ', '.join(nodes)))
        print()
        return nodes
    except utils.CommandError as err:
        utils.command_error(cmd, err.stderr)
    except FileNotFoundError:
        utils.kubectl_cmd_help(args.kubectl_cmd)