'Gets the nodes list from Rudder'

def get_nodes(self):

    path = '/nodes?select=nodeAndPolicyServer'
    result = self.api_call(path)
    nodes = {}
    for node in result['data']['nodes']:
        nodes[node['id']] = {}
        nodes[node['id']]['hostname'] = node['hostname']
        if ('properties' in node):
            nodes[node['id']]['properties'] = node['properties']
        else:
            nodes[node['id']]['properties'] = []
    return nodes
