relation-get output is problematic
Gustavo Niemeyer
gustavo.niemeyer at canonical.com
Sat May 12 22:15:46 UTC 2012
On Thu, May 10, 2012 at 4:30 PM, William Reade
<william.reade at canonical.com> wrote:
> Just to be explicit here, the various hooks tools fall into the
> following categories:
(...)
> Normal output:
> - config-get
> - relation-get
> - relation-ids
> - relation-list
>
> Each of these accepts all the above flags.
Indeed. Note that these commands are not all even. The relation-list
and relation-ids commands both have line-based output by default.
> Subtly different:
> - unit-get
>
> ...which is different only in that --test is basically meaningless:
> unit-get is only ever run in the context of an actual running unit,
> which is therefore guaranteed to have truthy values for private-address
> and public-address. To expose --test on unit-get would imply that this
> is not the case; and on principle I'm a little bit uncomfortable about
> doing this.
Why is unit-get different? To me it looks like it's part of the above
group of commands. The only reason why --test isn't useful in unit-get
right now is because we don't have any boolean options on it at the
moment. If we had, --test would be equally useful.
> It *would* be architecturally convenient to collect all these flags
> together, but I would only want to do so if we had general agreement
> that exposing a meaningless --test flag in this case was a reasonable
> thing to do (either because we may one day extend unit-get to expose
> potentially falsey values, or just in service of UI consistency).
It seems like a reasonable thing to do to me, unless I'm wrong above
for some reason.
gustavo @ http://niemeyer.net
More information about the Juju
mailing list