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

Matthew Wedgwood matthew.wedgwood at canonical.com
Thu Feb 21 17:10:57 UTC 2013


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.

> 
> I am not sure in which situation, use the former command and which use
> later command.
> 
> Thanks a lot for the help
> 
> [1] https://wiki.canonical.com/InformationInfrastructure/IS/JujuDeploySwift
> 





More information about the Juju mailing list