~charmers/charms/precise/cinder/trunk

« back to all changes in this revision

Viewing changes to hooks/cinder_hooks.py

  • Committer: Marco Ceppi
  • Date: 2013-11-04 00:25:51 UTC
  • mfrom: (24.1.1 cinder-current)
  • Revision ID: marco@ceppi.net-20131104002551-dcprz9nvdcjmgw5c
[james-page] Updates for ceilometer integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
 
109
109
 
110
110
@hooks.hook('amqp-relation-joined')
111
 
def amqp_joined():
 
111
def amqp_joined(relation_id=None):
112
112
    conf = config()
113
 
    relation_set(username=conf['rabbit-user'], vhost=conf['rabbit-vhost'])
 
113
    relation_set(relation_id=relation_id,
 
114
                 username=conf['rabbit-user'], vhost=conf['rabbit-vhost'])
114
115
 
115
116
 
116
117
@hooks.hook('amqp-relation-changed')
265
266
        identity_joined(rid=rid)
266
267
 
267
268
 
 
269
@hooks.hook('upgrade-charm')
 
270
def upgrade_charm():
 
271
    for rel_id in relation_ids('amqp'):
 
272
        amqp_joined(relation_id=rel_id)
 
273
 
 
274
 
268
275
if __name__ == '__main__':
269
276
    try:
270
277
        hooks.execute(sys.argv)