Added in a tenant for the mini-mon user
This commit is contained in:
parent
557020cd85
commit
4088725c96
@ -14,10 +14,18 @@ except keystoneclient.exceptions:
|
||||
key = client.Client(token='ADMIN', endpoint='http://127.0.0.1:35357/v2.0/')
|
||||
user_list = key.users.list()
|
||||
|
||||
# Create the tenant for mini-mon if it doesn't exist
|
||||
tenant_id = None
|
||||
for tenant in key.tenants.list():
|
||||
if tenant.name == 'mini-mon':
|
||||
tenant_id = tenant.id
|
||||
if tenant_id is None:
|
||||
tenant_id = key.tenants.create('mini-mon').id
|
||||
|
||||
# Create the user if it doesn't exist
|
||||
for user in user_list:
|
||||
if user.name == 'mini-mon':
|
||||
sys.exit(0)
|
||||
|
||||
key.users.create(name='mini-mon', password='password', email='mini@mon.com', enabled=True)
|
||||
key.users.create(name='mini-mon', password='password', email='mini@mon.com', tenant_id=tenant_id, enabled=True)
|
||||
EOH
|
||||
end
|
||||
|
@ -3,6 +3,7 @@
|
||||
"keystone_url": "https://localhost:35357/v3/auth/tokens",
|
||||
"user": "mini-mon",
|
||||
"password": "password",
|
||||
"project_name": "mini-mon",
|
||||
"mon_api_url" : "http://localhost:8080/v2.0",
|
||||
"service": "mini-mon"
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
"keystone_url": "https://192.168.10.4:35357/v3/auth/tokens",
|
||||
"user": "mini-mon",
|
||||
"password": "password",
|
||||
"project_name": "mini-mon",
|
||||
"mon_api_url" : "http://192.168.10.4:8080/v2.0",
|
||||
"service": "mini-mon"
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
"keystone_url": "https://10.22.156.20:35357/v3/auth/tokens",
|
||||
"user": "admin",
|
||||
"password": "password",
|
||||
"project_name": "demo",
|
||||
"mon_api_url": "http://localhost:8080/v2.0/metrics",
|
||||
"service": "demo"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user