What is the correct way to add relation between swift-proxy and swift-storage by juju

Ray Wang ray.wang at canonical.com
Fri Feb 22 01:45:07 UTC 2013


Hi Matthew,

On Fri, Feb 22, 2013 at 1:10 AM, Matthew Wedgwood
<matthew.wedgwood at canonical.com> wrote:
> On 02/21/2013 04:33 AM, Ray Wang wrote:> Hello all,
>>
>> I'm trying to figure out what is the correct way to add relation
>> between swift-proxy and swift-storage by juju.
>> I found a link[1] which says
>>
>>     $ juju add-relation swift-proxy:swift-proxy swift-storage:swift-proxy
>>
>> But I totally have no idea why add relation between
>> "swift-proxy:swift-proxy" and "swift-storage:swift-proxy"
>
> I think the reason for this one is that there are two possible relations between the charms. From the metadata:
>
> --- swift-proxy charm ---
> provides:
>   swift-proxy:
>     interface: swift
> [...]
> requires:
>   swift-storage:
>     interface: swift
> [...]
>
> --- swift-storage charm ---
> provides:
>   swift-storage:
>     interface: swift
> [...]
> requires:
>   swift-proxy:
>     interface: swift
> [...]
>
>> I also find there is a README in lp:charms/swift-proxy which says:
>>
>>     $ juju add-relation swift-proxy swift-storage
>
> The way the metadata reads, this is ambiguous because there's no way to know whether you want swift-proxy relation or a swift-storage relation.
>
> Looking at the hooks in those charms, the swift-storage relation isn't implemented in either so it would result in a noop. Those stanzas should probably be removed from the metadata. You'd then be able to use *either* of the relation-add invocations you cite and they'd both mean the same thing.

Thanks a lot for the explanation.
I'm wondering while adding relation between swift-proxy and
swift-storage will trigger noop, then why we still have to add
relation between them? :-)

-- 
Ray Wang
Canonical  www.canonical.com | Ubuntu  www.ubuntu.com



More information about the Juju mailing list