cosmos.py should tell you your API key has insufficient rights
When you try to run bootstrap-ci.py
with an API key that has Cloud Customer
rights, but no Customer
rights, you get this failure:
./ci-bootstrap.py --create-droplet
Creating droplet
Created droplet id: 1998
Waiting for droplet 1998 to reach running state...
Creating domain record
Traceback (most recent call last):
File "./ci-bootstrap.py", line 159, in <module>
update=True)
File "/home/users/maarten/projects/openappstack/bootstrap/test/cosmos.py", line 75, in create_domain_record
record_type=record_type)
File "/home/users/maarten/projects/openappstack/bootstrap/test/cosmos.py", line 142, in get_domain_record_by_name
records = get_domain_records(domain=domain)
File "/home/users/maarten/projects/openappstack/bootstrap/test/cosmos.py", line 156, in get_domain_records
response = request_api('domains/{0}/records'.format(domain))
File "/home/users/maarten/projects/openappstack/bootstrap/test/cosmos.py", line 56, in request_api
response.status_code, response.text)
Because the API key has insufficient rights to make DNS entries. This error should be caught and give the user a nice error message telling them to add Customer
rights to their API key in the Cosmos Service Centre