~james-page/charms/oneiric/glance/charm-tester

« back to all changes in this revision

Viewing changes to hooks/glance-relations

  • Committer: Adam Gandelman
  • Date: 2011-07-22 00:59:50 UTC
  • Revision ID: adamg@canonical.com-20110722005950-a5u7nmbsw9e15kn8
Add object-store relation for relating to swift

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
  relation-set glance-api-server="$bind_host:$bind_port"
63
63
}
64
64
 
 
65
function object-store_changed {
 
66
  URL=`relation-get url`
 
67
  USER=`relation-get user`
 
68
  PASSWORD=`relation-get password`
 
69
  [[ -z $URL ]] || [[ -z $USER ]] || [[ -z $PASSWORD ]] && \
 
70
    echo "URL||USER||PASSWORD not set, peer not ready?" && exit 0
 
71
  set_or_update default_store swift api
 
72
  set_or_update swift_store_user system:$USER api
 
73
  set_or_update swift_store_key $PASSWORD api
 
74
  set_or_update swift_store_auth_address $URL api
 
75
  set_or_update swift_store_create_container_on_put true api
 
76
 
 
77
}
 
78
 
65
79
case $ARG0 in
66
80
  "start"|"stop") exit 0 ;;
67
81
  "install") install_hook ;;
69
83
  "shared-db-relation-changed") db_changed;;
70
84
  "image-service-relation-joined") image-service_joined ;;
71
85
  "image-service-relation-changed") exit 0 ;;
 
86
  "object-store-relation-joined") exit 0 ;;
 
87
  "object-store-relation-changed") object-store_changed ;;
72
88
esac
73
89