本文整理汇总了Python中trove.guestagent.backup.restore函数的典型用法代码示例。如果您正苦于以下问题:Python restore函数的具体用法?Python restore怎么用?Python restore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了restore函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: do_prepare
def do_prepare(self, context, packages, databases, memory_mb, users,
device_path, mount_point, backup_info, config_contents,
root_password, overrides, cluster_config, snapshot):
pgutil.PG_ADMIN = self.PG_BUILTIN_ADMIN
self.install(context, packages)
self.stop_db(context)
if device_path:
device = volume.VolumeDevice(device_path)
device.format()
if os.path.exists(mount_point):
device.migrate_data(mount_point)
device.mount(mount_point)
self.configuration_manager.save_configuration(config_contents)
self.apply_initial_guestagent_configuration()
if backup_info:
pgutil.PG_ADMIN = self.ADMIN_USER
backup.restore(context, backup_info, '/tmp')
pgutil.PG_ADMIN = self.ADMIN_USER
if snapshot:
LOG.info("Found snapshot info: " + str(snapshot))
self.attach_replica(context, snapshot, snapshot['config'])
self.start_db(context)
if not backup_info:
self._secure(context)
if root_password and not backup_info:
self.enable_root(context, root_password)
开发者ID:cdelatte,项目名称:tesora-trove,代码行数:31,代码来源:manager.py
示例2: do_prepare
def do_prepare(
self,
context,
packages,
databases,
memory_mb,
users,
device_path,
mount_point,
backup_info,
config_contents,
root_password,
overrides,
cluster_config,
snapshot,
):
pgutil.PG_ADMIN = self.PG_BUILTIN_ADMIN
self.install(context, packages)
self.stop_db(context)
if device_path:
device = volume.VolumeDevice(device_path)
device.format()
if os.path.exists(mount_point):
device.migrate_data(mount_point)
device.mount(mount_point)
self.configuration_manager.save_configuration(config_contents)
self.apply_initial_guestagent_configuration()
self.start_db(context)
if backup_info:
backup.restore(context, backup_info, "/tmp")
pgutil.PG_ADMIN = self.ADMIN_USER
else:
self._secure(context)
开发者ID:slodha,项目名称:trove,代码行数:34,代码来源:manager.py
示例3: _perform_restore
def _perform_restore(self, backup_info, context, restore_location, app):
LOG.info(_("Restoring database from backup %s.") % backup_info["id"])
try:
backup.restore(context, backup_info, restore_location)
except Exception:
LOG.exception(_("Error performing restore from backup %s.") % backup_info["id"])
app.status.set_status(rd_instance.ServiceStatuses.FAILED)
raise
LOG.info(_("Restored database successfully."))
开发者ID:slodha,项目名称:trove,代码行数:9,代码来源:manager.py
示例4: _perform_restore
def _perform_restore(self, backup_id, context, restore_location, app):
LOG.info(_("Restoring database from backup %s") % backup_id)
try:
backup.restore(context, backup_id, restore_location)
except Exception as e:
LOG.error(e)
LOG.error("Error performing restore from backup %s", backup_id)
app.status.set_status(rd_models.ServiceStatuses.FAILED)
raise
LOG.info(_("Restored database successfully"))
开发者ID:CiscoSystems,项目名称:openstack-trove,代码行数:10,代码来源:mysql.py
示例5: _perform_restore
def _perform_restore(self, backup_info, context, restore_location, app):
LOG.info(_("Restoring database from backup %s") % backup_info['id'])
try:
backup.restore(context, backup_info, restore_location)
except Exception as e:
LOG.error(e)
LOG.error(_("Error performing restore from backup %s") %
backup_info['id'])
self.status.set_status(ds_instance.ServiceStatuses.FAILED)
raise
LOG.info(_("Restored database successfully"))
开发者ID:rumale,项目名称:trove,代码行数:11,代码来源:manager.py
示例6: _perform_restore
def _perform_restore(self, backup_info, context, restore_location, app):
LOG.info(_("Restoring database from backup %s.") % backup_info['id'])
try:
backup.restore(context, backup_info, restore_location)
except Exception:
LOG.exception(_("Error performing restore from backup %s.") %
backup_info['id'])
app.status.set_status(ds_instance.ServiceStatuses.FAILED)
raise
self.admin.delete_conf_cache()
self.app.paths.update_db_name(self.admin.database_name)
LOG.info(_("Restored database successfully."))
开发者ID:Tesora-Release,项目名称:tesora-trove,代码行数:12,代码来源:manager.py
示例7: _perform_restore
def _perform_restore(self, backup_info, context, restore_location):
LOG.info(_("Restoring database from backup %s.") % backup_info['id'])
try:
backup.restore(context, backup_info, restore_location)
self.app._apply_post_restore_updates(backup_info)
except Exception as e:
LOG.error(e)
LOG.error(_("Error performing restore from backup %s.") %
backup_info['id'])
self.app.status.set_status(trove_instance.ServiceStatuses.FAILED)
raise
LOG.info(_("Restored database successfully."))
开发者ID:Hopebaytech,项目名称:trove,代码行数:12,代码来源:manager.py
示例8: _perform_restore
def _perform_restore(self, backup_info, context, restore_location):
"""
Restores all couchbase buckets and their documents from the
backup.
"""
LOG.info(_("Restoring database from backup %s") % backup_info["id"])
try:
backup.restore(context, backup_info, restore_location)
except Exception as e:
LOG.error(_("Error performing restore from backup %s") % backup_info["id"])
LOG.error(e)
self.status.set_status(rd_instance.ServiceStatuses.FAILED)
raise
LOG.info(_("Restored database successfully"))
开发者ID:bbgw,项目名称:trove,代码行数:14,代码来源:manager.py
示例9: prepare
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,
snapshot=None
):
self.install(context, packages)
PgSqlAppStatus.get().begin_restart()
self.stop_db(context)
if device_path:
device = volume.VolumeDevice(device_path)
device.format()
if os.path.exists(mount_point):
device.migrate_data(mount_point)
device.mount(mount_point)
self.reset_configuration(context, config_contents)
self.set_db_to_listen(context)
self.start_db(context)
if backup_info:
backup.restore(context, backup_info, '/tmp')
if root_password and not backup_info:
self.enable_root(context, root_password)
PgSqlAppStatus.get().end_install_or_restart()
if databases:
self.create_database(context, databases)
if users:
self.create_user(context, users)
开发者ID:cp16net,项目名称:trove,代码行数:42,代码来源:manager.py
示例10: do_prepare
def do_prepare(self, context, packages, databases, memory_mb, users,
device_path, mount_point, backup_info, config_contents,
root_password, overrides, cluster_config, snapshot):
self.install(context, packages)
self.stop_db(context)
if device_path:
device = volume.VolumeDevice(device_path)
device.format()
if os.path.exists(mount_point):
device.migrate_data(mount_point)
device.mount(mount_point)
self.reset_configuration(context, config_contents)
self.set_db_to_listen(context)
self.start_db(context)
if backup_info:
backup.restore(context, backup_info, '/tmp')
if root_password and not backup_info:
self.enable_root(context, root_password)
开发者ID:jjmob,项目名称:trove,代码行数:20,代码来源:manager.py
示例11: do_prepare
def do_prepare(self, context, packages, databases, memory_mb, users,
device_path, mount_point, backup_info, config_contents,
root_password, overrides, cluster_config, snapshot):
self.app.install(context, packages)
LOG.debug("Waiting for database first boot.")
if (self.app.status.wait_for_real_status_to_change_to(
trove_instance.ServiceStatuses.RUNNING,
CONF.state_change_wait_time,
False)):
LOG.debug("Stopping database prior to initial configuration.")
self.app.stop_db()
if device_path:
device = volume.VolumeDevice(device_path)
device.format()
if os.path.exists(mount_point):
device.migrate_data(mount_point)
device.mount(mount_point)
self.configuration_manager.save_configuration(config_contents)
self.app.apply_initial_guestagent_configuration()
os_admin = models.PostgreSQLUser(self.app.ADMIN_USER)
if backup_info:
backup.restore(context, backup_info, '/tmp')
self.app.set_current_admin_user(os_admin)
if snapshot:
LOG.info("Found snapshot info: " + str(snapshot))
self.attach_replica(context, snapshot, snapshot['config'])
self.app.start_db()
if not backup_info:
self.app.secure(context)
self._admin = PgSqlAdmin(os_admin)
if not cluster_config and self.is_root_enabled(context):
self.status.report_root(context, self.app.default_superuser_name)
开发者ID:Tesora,项目名称:tesora-trove,代码行数:40,代码来源:manager.py
注:本文中的trove.guestagent.backup.restore函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论