~gnuoy/charms/trusty/nova-compute/1453940-stable

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/openstack/context.py

  • Committer: Liam Young
  • Date: 2014-09-09 09:47:14 UTC
  • mto: This revision was merged to the branch mainline in revision 117.
  • Revision ID: liam.young@canonical.com-20140909094714-17ewomeso8kdwtxt
Added 0mq support

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    relation_get,
22
22
    relation_ids,
23
23
    related_units,
 
24
    is_relation_made,
24
25
    relation_set,
25
26
    unit_get,
26
27
    unit_private_ip,
787
788
            'use_syslog': config('use-syslog')
788
789
        }
789
790
        return ctxt
 
791
 
 
792
 
 
793
class ZeroMQContext(OSContextGenerator):
 
794
    interfaces = ['zeromq-configuration']
 
795
 
 
796
    def __call__(self):
 
797
        ctxt = {}
 
798
        if is_relation_made('zeromq-configuration', 'host'):
 
799
            for rid in relation_ids('zeromq-configuration'):
 
800
                    for unit in related_units(rid):
 
801
                        ctxt['zmq_nonce'] = relation_get('nonce', unit, rid)
 
802
                        ctxt['zmq_host'] = relation_get('host', unit, rid)
 
803
        return ctxt
 
 
b'\\ No newline at end of file'