juju switch
David Cheney
david.cheney at canonical.com
Mon Apr 15 03:03:44 UTC 2013
I do not like this proposal, I think it confuses the meaning of
$JUJU_ENV / -e $ENVIRONMENT. Is this proposal really a panacea for Go
Juju's pedantic parsing of unknown environment keys ?
On 15/04/13 12:38, Tim Penhey wrote:
> 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.
I can't see how to do this an retain compatibility with Juju 0.6.
>
> Cheers,
> Tim
>
More information about the Juju-dev
mailing list