def test_neutron_api_relation_joined(self, get_cell_type, configs, isfile,
                                      rename, _canonical_url):
     nova_url = 'http://novaurl:8774/v2'
     isfile.return_value = True
     _identity_joined = self.patch('identity_joined')
     self.relation_ids.return_value = ['relid']
     _canonical_url.return_value = 'http://novaurl'
     get_cell_type.return_value = 'parent'
     self.uuid.uuid4.return_value = 'bob'
     hooks.neutron_api_relation_joined(remote_restart=True)
     self.assertTrue(_identity_joined.called)
     self.relation_set.assert_called_with(relation_id=None,
                                          cell_type='parent',
                                          nova_url=nova_url,
                                          restart_trigger='bob')
Beispiel #2
0
 def test_neutron_api_relation_joined(self, get_cell_type, configs, isfile,
                                      rename, _canonical_url):
     nova_url = 'http://novaurl:8774/v2'
     isfile.return_value = True
     _identity_joined = self.patch('identity_joined')
     self.relation_ids.return_value = ['relid']
     _canonical_url.return_value = 'http://novaurl'
     get_cell_type.return_value = 'parent'
     self.uuid.uuid4.return_value = 'bob'
     hooks.neutron_api_relation_joined(remote_restart=True)
     self.assertTrue(_identity_joined.called)
     self.relation_set.assert_called_with(relation_id=None,
                                          cell_type='parent',
                                          nova_url=nova_url,
                                          restart_trigger='bob')
 def test_neutron_api_relation_joined(self, get_cell_type, configs, isfile,
                                      rename, _canonical_url):
     neutron_conf = '/etc/neutron/neutron.conf'
     nova_url = 'http://novaurl:8774/v2'
     isfile.return_value = True
     self.service_running.return_value = True
     _identity_joined = self.patch('identity_joined')
     self.relation_ids.return_value = ['relid']
     _canonical_url.return_value = 'http://novaurl'
     get_cell_type.return_value = 'parent'
     self.uuid.uuid4.return_value = 'bob'
     with patch_open() as (_open, _file):
         hooks.neutron_api_relation_joined(remote_restart=True)
         self.service_stop.assert_called_with('neutron-server')
         rename.assert_called_with(neutron_conf, neutron_conf + '_unused')
         self.assertTrue(_identity_joined.called)
         self.relation_set.assert_called_with(relation_id=None,
                                              cell_type='parent',
                                              nova_url=nova_url,
                                              restart_trigger='bob')
 def test_neutron_api_relation_joined(self, get_cell_type, configs, isfile,
                                      rename, _canonical_url):
     neutron_conf = '/etc/neutron/neutron.conf'
     nova_url = 'http://novaurl:8774/v2'
     isfile.return_value = True
     self.service_running.return_value = True
     _identity_joined = self.patch('identity_joined')
     self.relation_ids.return_value = ['relid']
     _canonical_url.return_value = 'http://novaurl'
     get_cell_type.return_value = 'parent'
     self.uuid.uuid4.return_value = 'bob'
     with patch_open() as (_open, _file):
         hooks.neutron_api_relation_joined(remote_restart=True)
         self.service_stop.assert_called_with('neutron-server')
         rename.assert_called_with(neutron_conf, neutron_conf + '_unused')
         self.assertTrue(_identity_joined.called)
         self.relation_set.assert_called_with(relation_id=None,
                                              cell_type='parent',
                                              nova_url=nova_url,
                                              restart_trigger='bob')
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (do_action_openstack_upgrade('nova-common',
                                    do_openstack_upgrade,
                                    CONFIGS)):
        [neutron_api_relation_joined(rid=rid, remote_restart=True)
            for rid in relation_ids('neutron-api')]
        config_changed()
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (do_action_openstack_upgrade('nova-common', do_openstack_upgrade,
                                    CONFIGS)):
        [
            neutron_api_relation_joined(rid=rid, remote_restart=True)
            for rid in relation_ids('neutron-api')
        ]
        config_changed()
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (do_action_openstack_upgrade('nova-common', do_openstack_upgrade,
                                    CONFIGS)):
        [
            neutron_api_relation_joined(rid=rid, remote_restart=True)
            for rid in relation_ids('neutron-api')
        ]
        # NOTE(thedac): Force re-fire of shared-db joined hook
        # to ensure that nova_api database is setup if required.
        [db_joined(relation_id=r_id) for r_id in relation_ids('shared-db')]
        config_changed()