juju switch
Tim Penhey
tim.penhey at canonical.com
Mon Apr 15 02:38:01 UTC 2013
Hi People,
Jorge has been very determined to push for something like the bzr switch
command for working with multiple juju environments.
I've managed to work out how to implement `juju switch` without
violating the current behaviour.
Most of the developers just say "he should just use the JUJU_ENV
environment variable", as that takes precedence over the default
specified in environments.yaml.
We don't want switch modifying the main environments file, so what I
thought we could do is have something like:
${JUJU_HOME}/current-environment
as a text file that has a single line like:
amazon
This file is then inserted into the precedence rules for looking for the
environment:
1) ${JUJU_ENV}
2) ${JUJU_HOME}/current-environment
3) default from ${JUJU_HOME}/environments.yaml
`juju switch` could then just update that file.
juju switch some-env
would check to make sure some-env is a valid environment, and specify
that in the file if it is, and error if not
juju switch --delete
could delete the current-environment file to get back to "default"
behaviour
This is pretty trivial to do, and from comments from Jorge and Mark, I
think it adds actual value to the users. I think it is one day of work,
all tests included.
To make this more useful, I think `juju status` should output the
environment as the first line.
Cheers,
Tim
More information about the Juju-dev
mailing list