juju: How do I list all the relation variables and debug them interactively?
- by mfisch
I'm writing a charm that requires a mysql database, I found from looking at other charms that this (below) is how I get the info about the database:
user=`relation-get user`
password=`relation-get password`
mysqlhost=`relation-get private-address`
But I just found that from reading the wordpress charm example, is there a way to show all the relation variables that I can use?
Also, while debugging my db-relation-changed script, I wanted to ssh into my host and interactively run those commands, for example relation-get user, but it didn't work. I resorted to having to restart everything and use juju log to print them out. This wasted a lot of time. Is there a way to print out these relations, either from my dev box or from the instance running my charm? (Below is what happens when I tried to interactively run relation-get):
ubuntu@mfisch-local-tracks-0:~$ relation-get user
usage: relation-get [-h] [-o OUTPUT] [-s SOCKET] [--client-id CLIENT_ID]
[--format FORMAT] [--log-file FILE]
[--log-level CRITICAL|DEBUG|INFO|ERROR|WARNING]
[-r RELATION ID]
[settings_name] [unit_name]
No JUJU_AGENT_SOCKET/-s option found