Rely on ceph context to create /etc/ceph.

This commit is contained in:
Adam Gandelman 2013-08-23 13:21:59 -07:00
parent 1cf8730e9c
commit 0df05fa1a4
3 changed files with 4 additions and 11 deletions

View File

@ -157,8 +157,6 @@ def compute_changed():
@hooks.hook('ceph-relation-joined')
@restart_on_change(restart_map())
def ceph_joined():
if not os.path.isdir('/etc/ceph'):
os.mkdir('/etc/ceph')
apt_install(filter_installed_packages(['ceph-common']), fatal=True)

View File

@ -155,10 +155,10 @@ class NovaComputeContextTests(CharmTestCase):
def test_libvirt_bin_context_no_migration(self):
self.test_config.set('enable-live-migration', False)
libvirt = context.NovaComputeLibvirtContext()
self.assertEquals({'libvirtd_opts': '-d', 'listen_tls': 1}, libvirt())
self.assertEquals({'libvirtd_opts': '-d', 'listen_tls': 0}, libvirt())
def test_libvirt_bin_context_migration_tcp_listen(self):
self.test_config.set('enable-live-migration', True)
libvirt = context.NovaComputeLibvirtContext()
self.assertEquals(
{'libvirtd_opts': '-d -l', 'listen_tls': 1}, libvirt())
{'libvirtd_opts': '-d -l', 'listen_tls': 0}, libvirt())

View File

@ -153,8 +153,7 @@ class NovaComputeRelationsTests(CharmTestCase):
call(neutron_database='neutron',
neutron_username='neutron',
neutron_hostname='nova.foohost.com',
relation_id='shared-db:0'),
]
relation_id='shared-db:0')]
[self.assertIn(c, self.relation_set.call_args_list)
for c in calls]
self.unit_get.assert_called_with('private-address')
@ -237,12 +236,8 @@ class NovaComputeRelationsTests(CharmTestCase):
for func in expected_funcs:
self.assertTrue(func.called)
@patch('os.mkdir')
@patch('os.path.isdir')
def test_ceph_joined(self, isdir, mkdir):
isdir.return_value = False
def test_ceph_joined(self):
hooks.ceph_joined()
mkdir.assert_called_with('/etc/ceph')
self.apt_install.assert_called_with(['ceph-common'], fatal=True)
@patch.object(hooks, 'CONFIGS')