Important - proposed Juju plugin change
David Cheney
david.cheney at canonical.com
Thu Aug 1 01:31:56 UTC 2013
+1 for not requiring --, that is horrible.
-1 for cmd/juju not consuming any args it knows how to process. I
think cmd/juju should process -e and always export JUJU_ENV to the
subprocess.
On Thu, Aug 1, 2013 at 11:19 AM, Ian Booth <ian.booth at canonical.com> wrote:
> Hi folks
>
> Juju processes arguments used when calling a plugin, acting on common things;
> the main one is using -e to set the environment. However, this means plugins
> require the use of "--" to receive any additional arguments. eg
>
> juju myplugin -e myenv -- -pluginarg
>
> The above would set JUJU_ENV to myenv and pass -pluginarg to the plugin.
>
> This is kinda conceptually messy for the end user, having to know to use "--".
> And it's now made worse by the fact that the new simplestreams tools plugins
> which ship with Juju do not require "--" since they are built on top of Juju
> command infrastructure. So this works:
>
> juju metadata validate-images -e myenv -s raring
>
> If it were an "external" plugin, it would need to be:
>
> juju metadata validate-images -e myenv -- -s raring
>
> What we are proposing is to drop the "--". However, this means that:
>
> - plugins are responsible for processing *all* of their own arguments
> - common Juju arguments like "-e" are no longer automatically processed
>
> So if a plugin is called with "-e myenv", it will need to parse the -e itself
> and set JUJU_ENV and not count on it being done by Juju. Or course, if the
> plugin is written in Go, it can always use the built in parsing just like the
> simplestreams metadata plugin does.
>
> Can I please have feedback from anyone who has written a Juju plugin who would
> find the above change problematic? Users of plugins would just need to tweak any
> scripts which call them to remove the "--".
>
>
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
More information about the Juju-dev
mailing list