def update_nrpe_config(): # python-dbus is used by check_upstart_job apt_install('python-dbus') hostname = nrpe.get_nagios_hostname() current_unit = nrpe.get_nagios_unit_name() nrpe_setup = nrpe.NRPE(hostname=hostname) nrpe.copy_nrpe_checks() nrpe.add_init_service_checks(nrpe_setup, services(), current_unit) nrpe.add_haproxy_checks(nrpe_setup, current_unit) nrpe_setup.write()
def conditional_neutron_migration(): if os_release('nova-common') <= 'icehouse': log('Not running neutron database migration as migrations are handled ' 'by the neutron-server process.') elif os_release('nova-common') >= 'kilo': log('Not running neutron database migration as migrations are by ' 'the neutron-api charm.') else: status_set('maintenance', 'Running neutron db migration') migrate_neutron_database() # neutron-api service may have appeared while the migration was # running so prod it just in case [neutron_api_relation_joined(rid=rid, remote_restart=True) for rid in relation_ids('neutron-api')] if 'neutron-server' in services(): service_restart('neutron-server')
def conditional_neutron_migration(): if os_release('nova-common') <= 'icehouse': log('Not running neutron database migration as migrations are handled ' 'by the neutron-server process.') elif os_release('nova-common') >= 'kilo': log('Not running neutron database migration as migrations are by ' 'the neutron-api charm.') else: status_set('maintenance', 'Running neutron db migration') migrate_neutron_database() # neutron-api service may have appeared while the migration was # running so prod it just in case [ neutron_api_relation_joined(rid=rid, remote_restart=True) for rid in relation_ids('neutron-api') ] if 'neutron-server' in services(): service_restart('neutron-server')