summaryrefslogtreecommitdiffstats
path: root/salt/_modules/nbroles.py
blob: 54c4b79acd512472b6f5179df8d5116110731e1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#to-do: tidy this up, make host configurable

import requests

host = 'http://127.0.0.1:5000/roles?machine='

def get(name):
    req = requests.get(host + name)
    if req.status_code == 404:
        return([])
    if req.status_code == 200:
        return(req.json()['roles'])