Fix clone action

This commit is contained in:
Marek Marczykowski-Górecki 2013-12-14 02:55:41 +01:00
parent f604f8a1dd
commit 386c155dd5

View File

@ -1380,14 +1380,15 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
def do_clone_vm(self, vm, dst_name, thread_monitor): def do_clone_vm(self, vm, dst_name, thread_monitor):
dst_vm = None
try: try:
self.qvm_collection.lock_db_for_writing() self.qvm_collection.lock_db_for_writing()
self.qvm_collection.load() self.qvm_collection.load()
src_vm = self.qvm_collection[vm.qid] src_vm = self.qvm_collection[vm.qid]
dst_vm = qvm_collection.add_new_vm(src_vm.__class__.__name__, dst_vm = self.qvm_collection.add_new_vm(src_vm.__class__.__name__,
name=dst_name, template=src_vm.template, name=dst_name, template=src_vm.template,
dir_path=options.dir_path, installed_by_rpm=False) installed_by_rpm=False)
dst_vm.clone_attrs(src_vm) dst_vm.clone_attrs(src_vm)
dst_vm.clone_disk_files (src_vm=src_vm, verbose=False) dst_vm.clone_disk_files (src_vm=src_vm, verbose=False)