Fixed a small bug with Qube Manager status refresh

On change of template Vm status, qube Manager errored
out. It no logner does that.
This commit is contained in:
Marta Marczykowska-Górecka 2018-09-14 18:01:20 +02:00
parent 8d99fdd11b
commit cbf2e2154d
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B

View File

@ -468,8 +468,8 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
self.table_selection_changed() self.table_selection_changed()
if vm.klass == 'TemplateVM': if vm.klass == 'TemplateVM':
for row in self.vms_in_table: for row in self.vms_in_table.values():
if row.vm.template == vm: if getattr(row.vm, 'template', None) == vm:
row.info_widget.update_vm_state() row.info_widget.update_vm_state()
def on_domain_changed(self, vm, _event, **_kwargs): def on_domain_changed(self, vm, _event, **_kwargs):
@ -883,7 +883,6 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
if reply == QtGui.QMessageBox.Yes: if reply == QtGui.QMessageBox.Yes:
self.shutdown_vm(vm) self.shutdown_vm(vm)
def shutdown_vm(self, vm, shutdown_time=vm_shutdown_timeout, def shutdown_vm(self, vm, shutdown_time=vm_shutdown_timeout,
check_time=vm_restart_check_timeout, and_restart=False): check_time=vm_restart_check_timeout, and_restart=False):
try: try: