aboutsummaryrefslogtreecommitdiffstats
path: root/tests/get_keystone_projects.py
blob: 9b5d87cd94adbdbe3b9fff3d899f425d14c23881 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from python_moonclient import parse, models, policies, pdp


if __name__ == "__main__":
    args = parse.parse()
    consul_host = args.consul_host
    consul_port = args.consul_port

    models.init(consul_host, consul_port)
    policies.init(consul_host, consul_port)
    pdp.init(consul_host, consul_port)

    projects = pdp.get_keystone_projects()

    for _project in projects['projects']:
        print("{} {}".format(_project['id'], _project['name']))