Skip to content

Instantly share code, notes, and snippets.

@freyes
Last active May 23, 2019 15:15
Show Gist options
  • Save freyes/9fe2ba1f25a111023e52159c6dd89811 to your computer and use it in GitHub Desktop.
Save freyes/9fe2ba1f25a111023e52159c6dd89811 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
# Usage:
# ./read_relation.sh <RELATION> <UNIT> <UNIT_TO_READ_FROM>
# Example:
# ./read_relation.sh identity-service cinder/0 keystone/0
#
# In this example we are reading the data contained in the identity-service
# relation between cinder/0 and keystone/0.
INTERFACE="$1"
UNIT1=$2
UNIT2=$3
set -x
RELATION_ID=$(juju run --unit $UNIT1 "relation-ids $INTERFACE")
juju run --unit $UNIT1 "relation-get -r $RELATION_ID - $UNIT2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment