Xenvman Python

Just a quick note about the first version of xenvman Python client package.

Now it’s very easy to start using xenvman in Python projects as well!

Example

import xenvman

cl = xenvman.Client()

env = cl.new_env(xenvman.InputEnv(
    "python-test",
    description="Python test!",
    templates=[
        xenvman.Tpl("db/mongo")
    ],
))

cont = env.get_container("db/mongo", 0, "mongo")

# Get the full mongo url with exposed port
mongo_url = "{}:{}".format(env.external_address(), cont.ports["27017"])

# connect to mongo via mongo_url, perform all the needed tests

env.terminate()

xenvman

72 Words

2019-01-31 22:56 -0500

comments powered by Disqus