Merge "Wait for Couchbase to be ready before node-init"
This commit is contained in:
commit
c0ef10ec6c
@ -64,6 +64,7 @@ class Manager(periodic_task.PeriodicTasks):
|
|||||||
prepare handles all the base configuration of the Couchbase instance.
|
prepare handles all the base configuration of the Couchbase instance.
|
||||||
"""
|
"""
|
||||||
self.appStatus.begin_install()
|
self.appStatus.begin_install()
|
||||||
|
self.app.install_if_needed(packages)
|
||||||
if device_path:
|
if device_path:
|
||||||
device = volume.VolumeDevice(device_path)
|
device = volume.VolumeDevice(device_path)
|
||||||
# unmount if device is already mounted
|
# unmount if device is already mounted
|
||||||
@ -71,10 +72,11 @@ class Manager(periodic_task.PeriodicTasks):
|
|||||||
device.format()
|
device.format()
|
||||||
device.mount(mount_point)
|
device.mount(mount_point)
|
||||||
LOG.debug('Mounted the volume.')
|
LOG.debug('Mounted the volume.')
|
||||||
|
self.app.start_db_with_conf_changes(config_contents)
|
||||||
|
LOG.info(_('Securing couchbase now.'))
|
||||||
if root_password:
|
if root_password:
|
||||||
self.app.enable_root(root_password)
|
self.app.enable_root(root_password)
|
||||||
self.app.install_if_needed(packages)
|
self.app.initial_setup()
|
||||||
LOG.info(_('Securing couchbase now.'))
|
|
||||||
self.app.complete_install_or_restart()
|
self.app.complete_install_or_restart()
|
||||||
LOG.info(_('"prepare" couchbase call has finished.'))
|
LOG.info(_('"prepare" couchbase call has finished.'))
|
||||||
|
|
||||||
|
@ -58,7 +58,6 @@ class CouchbaseApp(object):
|
|||||||
if not packager.pkg_is_installed(packages):
|
if not packager.pkg_is_installed(packages):
|
||||||
LOG.info(_('Installing Couchbase'))
|
LOG.info(_('Installing Couchbase'))
|
||||||
self._install_couchbase(packages)
|
self._install_couchbase(packages)
|
||||||
self.initial_setup()
|
|
||||||
|
|
||||||
def initial_setup(self):
|
def initial_setup(self):
|
||||||
self.ip_address = operating_system.get_ip_address()
|
self.ip_address = operating_system.get_ip_address()
|
||||||
|
@ -73,6 +73,10 @@ class GuestAgentCouchbaseManagerTest(testtools.TestCase):
|
|||||||
volume.VolumeDevice.mount_points = MagicMock(return_value=[])
|
volume.VolumeDevice.mount_points = MagicMock(return_value=[])
|
||||||
couch_service.CouchbaseApp.install_if_needed = MagicMock(
|
couch_service.CouchbaseApp.install_if_needed = MagicMock(
|
||||||
return_value=None)
|
return_value=None)
|
||||||
|
couch_service.CouchbaseApp.start_db_with_conf_changes = MagicMock(
|
||||||
|
return_value=None)
|
||||||
|
couch_service.CouchbaseApp.initial_setup = MagicMock(
|
||||||
|
return_value=None)
|
||||||
couch_service.CouchbaseApp.complete_install_or_restart = MagicMock(
|
couch_service.CouchbaseApp.complete_install_or_restart = MagicMock(
|
||||||
return_value=None)
|
return_value=None)
|
||||||
|
|
||||||
|
@ -1599,13 +1599,11 @@ class CouchbaseAppTest(testtools.TestCase):
|
|||||||
self.assertTrue(conductor_api.API.heartbeat.called)
|
self.assertTrue(conductor_api.API.heartbeat.called)
|
||||||
|
|
||||||
def test_install_when_couchbase_installed(self):
|
def test_install_when_couchbase_installed(self):
|
||||||
self.couchbaseApp.initial_setup = Mock()
|
|
||||||
couchservice.packager.pkg_is_installed = Mock(return_value=True)
|
couchservice.packager.pkg_is_installed = Mock(return_value=True)
|
||||||
couchservice.utils.execute_with_timeout = Mock()
|
couchservice.utils.execute_with_timeout = Mock()
|
||||||
|
|
||||||
self.couchbaseApp.install_if_needed(["package"])
|
self.couchbaseApp.install_if_needed(["package"])
|
||||||
self.assertTrue(couchservice.packager.pkg_is_installed.called)
|
self.assertTrue(couchservice.packager.pkg_is_installed.called)
|
||||||
self.assertTrue(self.couchbaseApp.initial_setup.called)
|
|
||||||
self.assert_reported_status(rd_instance.ServiceStatuses.NEW)
|
self.assert_reported_status(rd_instance.ServiceStatuses.NEW)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user