Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
@when('mongodb.database.available')
def configure_mongodb(mongo):
t = '{"name":"juju-mongo", "config": {"type": "mongo","connection": "mongodb://'+mongo.connection_string()+'/","enabled": true}}'
req = urllib.request.Request('http://localhost:8047/storage/juju-mongo.json')
req.add_header('Content-Type', 'application/json')
response = urllib.request.URLopener(req, t)
log("Mongo ds response was:" +response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment