Merge pull request #2993 from hgross/fix/restore-on-docker-volumes
Fix #2992 (restore mechanism on docker volumes)
This commit is contained in:
2 files changed
+5
-4
No files matched your search
@@ -94,6 +94,7 @@ date of first contribution):
|
||||
* [Gaston Dombiak](https://github.com/gdombiak)
|
||||
* [Brad Fisher](https://github.com/bradcfisher)
|
||||
* [Aldo Hoeben](https://github.com/fieldofview)
|
||||
* [Henning Groß](https://github.com/hgross)
|
||||
* [Jubaleth](https://github.com/jubaleth)
|
||||
|
||||
OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by
|
||||
|
||||
@@ -684,7 +684,7 @@ class BackupPlugin(octoprint.plugin.SettingsPlugin,
|
||||
if len(plugins):
|
||||
zip.writestr("plugin_list.json", json.dumps(plugins))
|
||||
|
||||
os.rename(temporary_path, final_path)
|
||||
shutil.move(temporary_path, final_path)
|
||||
|
||||
if callable(on_backup_done):
|
||||
on_backup_done(name, final_path, exclude)
|
||||
@@ -834,18 +834,18 @@ class BackupPlugin(octoprint.plugin.SettingsPlugin,
|
||||
|
||||
if callable(on_log_progress):
|
||||
on_log_progress(u"Renaming {} to {}...".format(basedir, basedir_backup))
|
||||
os.rename(basedir, basedir_backup)
|
||||
shutil.move(basedir, basedir_backup)
|
||||
|
||||
try:
|
||||
if callable(on_log_progress):
|
||||
on_log_progress(u"Moving {} to {}...".format(basedir_extracted, basedir))
|
||||
os.rename(basedir_extracted, basedir)
|
||||
shutil.move(basedir_extracted, basedir)
|
||||
except:
|
||||
if callable(on_log_error):
|
||||
on_log_error(u"Error while restoring config data", exc_info=sys.exc_info())
|
||||
on_log_error(u"Rolling back old config data")
|
||||
|
||||
os.rename(basedir_backup, basedir)
|
||||
shutil.move(basedir_backup, basedir)
|
||||
|
||||
if callable(on_restore_failed):
|
||||
on_restore_failed(path)
|
||||
|
||||
Reference in new issue
Block a user