Important - proposed Juju plugin change

Ian Booth ian.booth at canonical.com
Thu Aug 1 01:19:16 UTC 2013


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 "--".





More information about the Juju-dev mailing list