Пример #1
0
def lxc_changed():
    nonce = relation_get('nonce')
    db = kv()
    if nonce and db.get('lxd-nonce') != nonce:
        db.set('lxd-nonce', nonce)
        configure_lxd(user='******')
        CONFIGS.write(NOVA_CONF)
 def test_configure_lxd_vivid(self, _configure_subuid, _lxc_list):
     self.lsb_release.return_value = {
         'DISTRIB_CODENAME': 'vivid'
     }
     utils.configure_lxd('nova')
     _configure_subuid.assert_called_with('nova')
     _lxc_list.assert_called_with('nova')
 def test_configure_lxd_pre_vivid(self, _configure_subuid, _lxc_list,
                                  _git_install):
     _git_install.return_value = False
     self.lsb_release.return_value = {'DISTRIB_CODENAME': 'trusty'}
     with self.assertRaises(Exception):
         utils.configure_lxd('nova')
     self.assertFalse(_configure_subuid.called)
Пример #4
0
def lxc_changed():
    nonce = relation_get('nonce')
    db = kv()
    if nonce and db.get('lxd-nonce') != nonce:
        db.set('lxd-nonce', nonce)
        configure_lxd(user='******')
        service_restart('nova-compute')
def lxc_changed():
    nonce = relation_get('nonce')
    db = kv()
    if nonce and db.get('lxd-nonce') != nonce:
        db.set('lxd-nonce', nonce)
        configure_lxd(user='******')
        CONFIGS.write(NOVA_CONF)
 def test_configure_lxd_pre_vivid(self, _configure_subuid, _lxc_list):
     self.lsb_release.return_value = {
         'DISTRIB_CODENAME': 'trusty'
     }
     with self.assertRaises(Exception):
         utils.configure_lxd('nova')
     self.assertFalse(_configure_subuid.called)
Пример #7
0
def lxc_changed():
    nonce = relation_get('nonce')
    db = kv()
    if nonce and db.get('lxd-nonce') != nonce:
        db.set('lxd-nonce', nonce)
        configure_lxd(user='******')
        if not is_unit_paused_set():
            service_restart('nova-compute')
Пример #8
0
def config_changed():
    if config('prefer-ipv6'):
        status_set('maintenance', 'configuring ipv6')
        assert_charm_supports_ipv6()

    global CONFIGS
    if git_install_requested():
        if config_value_changed('openstack-origin-git'):
            status_set('maintenance', 'Running Git install')
            git_install(config('openstack-origin-git'))
    elif not config('action-managed-upgrade'):
        if openstack_upgrade_available('nova-common'):
            status_set('maintenance', 'Running openstack upgrade')
            do_openstack_upgrade(CONFIGS)

    sysctl_dict = config('sysctl')
    if sysctl_dict:
        create_sysctl(sysctl_dict, '/etc/sysctl.d/50-nova-compute.conf')

    if migration_enabled() and config('migration-auth-type') == 'ssh':
        # Check-in with nova-c-c and register new ssh key, if it has just been
        # generated.
        status_set('maintenance', 'SSH key exchange')
        initialize_ssh_keys()
        import_authorized_keys()

    if config('enable-resize') is True:
        enable_shell(user='******')
        status_set('maintenance', 'SSH key exchange')
        initialize_ssh_keys(user='******')
        import_authorized_keys(user='******', prefix='nova')
    else:
        disable_shell(user='******')

    if config('instances-path') is not None:
        fp = config('instances-path')
        fix_path_ownership(fp, user='******')

    if config('virt-type').lower() == 'lxd':
        configure_lxd(user='******')

    [compute_joined(rid) for rid in relation_ids('cloud-compute')]
    for rid in relation_ids('zeromq-configuration'):
        zeromq_configuration_relation_joined(rid)

    if is_relation_made("nrpe-external-master"):
        update_nrpe_config()

    if config('hugepages'):
        install_hugepages()

    CONFIGS.write_all()