Re: Control different relation sequence

2013-09-04 Thread Kapil Thangavelu
The missing command here is relation-ids to list the relation ids of a given relation name. JUJU_RELATION_ID gives the current relation be executed for, to trigger/inspect state on other relations, the relation-ids command can be used to find their id, which can be passed to relation-get/set with -

Re: Control different relation sequence

2013-09-04 Thread Gustavo Niemeyer
Exactly, that's what I would probably do as well. Once you are within a relation you want to wait for further actions, dump the $JUJU_RELATION_ID into a file and wait until you want to wake it up again. Hooks are guaranteed to be run in series, so you don't have to worry about concurrency issues a

Re: Control different relation sequence

2013-09-03 Thread Gustavo Niemeyer
The relation-set command accepts a "-r" parameter which takes the relation id to act upon. You can pick the relation id of an executing hook from the JUJU_RELATION_ID environment variable. This way you can act across relations. Hopefully this will be better documented at some point. On Tue, Sep 3