backups: update for simplified restore API calls
This commit is contained in:
parent
c5ed749c22
commit
745b5d479f
@ -135,21 +135,18 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
|
|||||||
str(self.appvm_combobox.currentText()))
|
str(self.appvm_combobox.currentText()))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.restore_tmpdir, qubes_xml = backup.backup_restore_header(
|
|
||||||
str(self.dir_line_edit.text()),
|
|
||||||
str(self.passphrase_line_edit.text()),
|
|
||||||
encrypted=self.encryption_checkbox.isChecked(),
|
|
||||||
appvm=self.target_appvm)
|
|
||||||
self.vms_to_restore = backup.backup_restore_prepare(
|
self.vms_to_restore = backup.backup_restore_prepare(
|
||||||
str(self.dir_line_edit.text()),
|
str(self.dir_line_edit.text()),
|
||||||
os.path.join(self.restore_tmpdir, qubes_xml),
|
|
||||||
str(self.passphrase_line_edit.text()),
|
str(self.passphrase_line_edit.text()),
|
||||||
options=self.restore_options,
|
options=self.restore_options,
|
||||||
host_collection=self.qvm_collection,
|
host_collection=self.qvm_collection,
|
||||||
encrypt=self.encryption_checkbox.isChecked(),
|
encrypted=self.encryption_checkbox.isChecked(),
|
||||||
appvm=self.target_appvm)
|
appvm=self.target_appvm)
|
||||||
|
|
||||||
for vmname in self.vms_to_restore:
|
for vmname in self.vms_to_restore:
|
||||||
|
if vmname.startswith('$'):
|
||||||
|
# Internal info
|
||||||
|
continue
|
||||||
self.select_vms_widget.available_list.addItem(vmname)
|
self.select_vms_widget.available_list.addItem(vmname)
|
||||||
except QubesException as ex:
|
except QubesException as ex:
|
||||||
QMessageBox.warning (None, "Restore error!", str(ex))
|
QMessageBox.warning (None, "Restore error!", str(ex))
|
||||||
@ -188,17 +185,11 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
|
|||||||
err_msg = []
|
err_msg = []
|
||||||
self.qvm_collection.lock_db_for_writing()
|
self.qvm_collection.lock_db_for_writing()
|
||||||
try:
|
try:
|
||||||
backup.backup_restore_do(
|
backup.backup_restore_do(self.vms_to_restore,
|
||||||
str(self.dir_line_edit.text()),
|
self.qvm_collection,
|
||||||
self.restore_tmpdir,
|
print_callback=self.restore_output,
|
||||||
str(self.passphrase_line_edit.text()),
|
error_callback=self.restore_error_output,
|
||||||
self.vms_to_restore,
|
progress_callback=self.update_progress_bar)
|
||||||
self.qvm_collection,
|
|
||||||
encrypted=self.encryption_checkbox.isChecked(),
|
|
||||||
appvm=self.target_appvm,
|
|
||||||
print_callback=self.restore_output,
|
|
||||||
error_callback=self.restore_error_output,
|
|
||||||
progress_callback=self.update_progress_bar)
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print "Exception:", ex
|
print "Exception:", ex
|
||||||
err_msg.append(str(ex))
|
err_msg.append(str(ex))
|
||||||
@ -270,8 +261,9 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
|
|||||||
|
|
||||||
def all_vms_good(self):
|
def all_vms_good(self):
|
||||||
for vminfo in self.vms_to_restore.values():
|
for vminfo in self.vms_to_restore.values():
|
||||||
|
if not vminfo.has_key('vm'):
|
||||||
|
continue
|
||||||
if not vminfo['good-to-go']:
|
if not vminfo['good-to-go']:
|
||||||
print vminfo['vm'].name, str(vminfo)
|
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user