~corey.bryant/charms/trusty/nova-compute/amulet-novacc

« back to all changes in this revision

Viewing changes to hooks/nova_compute_hooks.py

  • Committer: Liam Young
  • Date: 2015-04-01 15:13:54 UTC
  • mfrom: (79.3.29 nova-compute)
  • Revision ID: liam.young@canonical.com-20150401151354-ygf2jf3a3qpl50ug
[james-page, r=gnuoy] Add 0mq support

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from charmhelpers.contrib.openstack.utils import (
31
31
    configure_installation_source,
32
32
    openstack_upgrade_available,
 
33
    os_requires_version,
33
34
)
34
35
 
35
36
from charmhelpers.contrib.storage.linux.ceph import (
57
58
    ceph_config_file, CEPH_SECRET,
58
59
    enable_shell, disable_shell,
59
60
    fix_path_ownership,
 
61
    get_topics,
60
62
    assert_charm_supports_ipv6,
61
63
    manage_ovs,
62
64
)
118
120
        fix_path_ownership(fp, user='nova')
119
121
 
120
122
    [compute_joined(rid) for rid in relation_ids('cloud-compute')]
 
123
    for rid in relation_ids('zeromq-configuration'):
 
124
        zeromq_configuration_relation_joined(rid)
121
125
 
122
126
    update_nrpe_config()
123
127
 
316
320
    CONFIGS.write_all()
317
321
 
318
322
 
 
323
@hooks.hook('zeromq-configuration-relation-joined')
 
324
@os_requires_version('kilo', 'nova-common')
 
325
def zeromq_configuration_relation_joined(relid=None):
 
326
    relation_set(relation_id=relid,
 
327
                 topics=" ".join(get_topics()),
 
328
                 users="nova")
 
329
 
 
330
 
 
331
@hooks.hook('zeromq-configuration-relation-changed')
 
332
@restart_on_change(restart_map())
 
333
def zeromq_configuration_relation_changed():
 
334
    CONFIGS.write(NOVA_CONF)
 
335
 
 
336
 
319
337
@hooks.hook('nrpe-external-master-relation-joined',
320
338
            'nrpe-external-master-relation-changed')
321
339
def update_nrpe_config():