Esempio n. 1
0
 def prepare(self, context, packages, databases, memory_mb, users,
             device_path=None, mount_point=None, backup_info=None,
             config_contents=None, root_password=None, overrides=None,
             cluster_config=None):
     """
     This is called when the trove instance first comes online.
     It is the first rpc message passed from the task manager.
     prepare handles all the base configuration of the redis instance.
     """
     try:
         app = RedisApp(RedisAppStatus.get())
         RedisAppStatus.get().begin_install()
         if device_path:
             device = volume.VolumeDevice(device_path)
             # unmount if device is already mounted
             device.unmount_device(device_path)
             device.format()
             device.mount(mount_point)
             operating_system.update_owner('redis', 'redis', mount_point)
             LOG.debug('Mounted the volume.')
         app.install_if_needed(packages)
         LOG.info(_('Writing redis configuration.'))
         app.write_config(config_contents)
         app.restart()
         LOG.info(_('Redis instance has been setup and configured.'))
     except Exception:
         LOG.exception(_("Error setting up Redis instance."))
         app.status.set_status(rd_instance.ServiceStatuses.FAILED)
         raise RuntimeError("prepare call has failed.")
Esempio n. 2
0
 def prepare(self,
             context,
             packages,
             databases,
             memory_mb,
             users,
             device_path=None,
             mount_point=None,
             backup_info=None,
             config_contents=None,
             root_password=None,
             overrides=None):
     """
     This is called when the trove instance first comes online.
     It is the first rpc message passed from the task manager.
     prepare handles all the base configuration of the redis instance.
     """
     app = RedisApp(RedisAppStatus.get())
     RedisAppStatus.get().begin_install()
     if device_path:
         device = volume.VolumeDevice(device_path)
         device.format()
         device.mount(mount_point)
         LOG.debug(_('Mounted the volume.'))
     app.install_if_needed(packages)
     LOG.info(_('Securing redis now.'))
     app.write_config(config_contents)
     app.complete_install_or_restart()
     LOG.info(_('"prepare" redis call has finished.'))
Esempio n. 3
0
 def prepare(self, context, packages, databases, memory_mb, users,
             device_path=None, mount_point=None, backup_info=None,
             config_contents=None, root_password=None, overrides=None):
     """
     This is called when the trove instance first comes online.
     It is the first rpc message passed from the task manager.
     prepare handles all the base configuration of the redis instance.
     """
     try:
         app = RedisApp(RedisAppStatus.get())
         RedisAppStatus.get().begin_install()
         if device_path:
             device = volume.VolumeDevice(device_path)
             # unmount if device is already mounted
             device.unmount_device(device_path)
             device.format()
             device.mount(mount_point)
             operating_system.update_owner('redis', 'redis', mount_point)
             LOG.debug('Mounted the volume.')
         app.install_if_needed(packages)
         LOG.info(_('Securing redis now.'))
         app.write_config(config_contents)
         app.restart()
         LOG.info(_('"prepare" redis call has finished.'))
     except Exception as e:
         LOG.error(e)
         app.status.set_status(rd_instance.ServiceStatuses.FAILED)
         raise RuntimeError("prepare call has failed.")
Esempio n. 4
0
 def prepare(
     self,
     context,
     packages,
     databases,
     memory_mb,
     users,
     device_path=None,
     mount_point=None,
     backup_info=None,
     config_contents=None,
     root_password=None,
 ):
     """
     This is called when the trove instance first comes online.
     It is the first rpc message passed from the task manager.
     prepare handles all the base configuration of the redis instance.
     """
     app = RedisApp(RedisAppStatus.get())
     RedisAppStatus.get().begin_install()
     if device_path:
         device = volume.VolumeDevice(device_path)
         device.format()
         device.mount(system.REDIS_BASE_DIR)
         LOG.debug(_("Mounted the volume."))
     app.install_if_needed(packages)
     LOG.info(_("Securing redis now."))
     app.write_config(config_contents)
     app.complete_install_or_restart()
     LOG.info(_('"prepare" redis call has finished.'))