Important - proposed Juju plugin change

Ian Booth ian.booth at canonical.com
Thu Aug 1 01:40:22 UTC 2013


Don't change anything yet!
At this stage it's just up for discussion :-)

On Thu 01 Aug 2013 11:38:39 EST, Marco Ceppi wrote:
> +1 from me, I'll make the change in the only plugin to reflect this. Thanks
> for the heads up!
>
>
> On Wed, Jul 31, 2013 at 9:34 PM, Mark Mims <mark.mims at canonical.com> wrote:
>
>> +1... ok with plugins parsimg everything they need and/or taking
>> responsibility to pass them along to actual subcommands.
>>
>> -- (mobile)
>> Mark Mims, Ph.D.
>> Ubuntu Server Team
>> Canonical Ltd
>> mark.mims at canonical.com
>> +1(512)981-6467
>>
>> On Jul 31, 2013, at 15:27, Ian Booth <ian.booth at canonical.com> wrote:
>>
>>> Sending to you guys directly as well....
>>>
>>>
>>> -------- Original Message --------
>>> Subject: Important - proposed Juju plugin change
>>> Date: Thu, 01 Aug 2013 11:19:16 +1000
>>> From: Ian Booth <ian.booth at canonical.com>
>>> To: juju-dev at lists.ubuntu.com <Juju-dev at lists.ubuntu.com>
>>>
>>> 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