~openstack-charmers-next/charms/vivid/nova-compute/trunk

« back to all changes in this revision

Viewing changes to unit_tests/test_nova_compute_hooks.py

  • Committer: James Page
  • Date: 2016-04-08 10:06:51 UTC
  • Revision ID: james.page@ubuntu.com-20160408100651-t18z7xdyuue1w1m4
Drop support for legacy Neutron management

The nova-compute charm originally managed the Neutron services
and configuration files for the hypervisor units; this has be
devolved into subordinate charms such as neutron-openvswitch
providing a nicer separation between Nova and Neutron.

Drop remaining legacy Neutron support from this charm as it was
deprecated for removal last cycle.

Change-Id: If3bd62d169c8e8804570c75e7311bf005c13683a

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
    'initialize_ssh_keys',
54
54
    'migration_enabled',
55
55
    'do_openstack_upgrade',
56
 
    'network_manager',
57
 
    'manage_ovs',
58
56
    'public_ssh_key',
59
57
    'register_configs',
60
58
    'disable_shell',
273
271
        configs.complete_contexts = MagicMock()
274
272
        configs.complete_contexts.return_value = ['amqp']
275
273
        configs.write = MagicMock()
276
 
        if neutron:
277
 
            self.network_manager.return_value = 'neutron'
278
274
        hooks.amqp_changed()
279
275
 
280
276
    @patch.object(hooks, 'CONFIGS')
281
277
    def test_amqp_changed_with_data_no_neutron(self, configs):
282
 
        self._amqp_test(configs, neutron=False)
283
 
        self.assertEquals([call('/etc/nova/nova.conf')],
284
 
                          configs.write.call_args_list)
285
 
 
286
 
    @patch.object(hooks, 'CONFIGS')
287
 
    def test_amqp_changed_with_data_and_neutron(self, configs):
288
 
        self.relation_ids.return_value = []
289
 
        self._amqp_test(configs, neutron=True)
290
 
        self.assertEquals([call('/etc/nova/nova.conf'),
291
 
                           call('/etc/neutron/neutron.conf')],
292
 
                          configs.write.call_args_list)
293
 
 
294
 
    @patch.object(hooks, 'CONFIGS')
295
 
    def test_amqp_changed_with_data_and_neutron_api(self, configs):
296
 
        self.manage_ovs.return_value = False
297
 
        self.relation_ids.return_value = ['neutron-plugin:0']
298
 
        self._amqp_test(configs, neutron=True)
 
278
        self._amqp_test(configs)
299
279
        self.assertEquals([call('/etc/nova/nova.conf')],
300
280
                          configs.write.call_args_list)
301
281