You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not critical, just code cleanliness.
I have managed to somehow ruin my test course (ironically, named 'The Best Course') and triggered an exception we maybe did not get in a while. In handling that exception we are referencing a missing attribute:
Unexpected error I have noticed: File "/home/vital/vital2.0/source/virtual_lab/vital_site/vital/views/student_view.py", line 198, in start_vm
XenClient().remove_network_bridges(vm.xen_server, request.user, course_id, vm_id)
AttributeError: 'Virtual_Machine' object has no attribute 'xen_server'
Code triggering error:
except Exception as e:
logger.error(str(e))
audit(request, 'Error starting Virtual machine ' + str(vm.name) + '( ' + e.message + ' )')
if 'Connection refused' not in str(e).rstrip() or started_vm is not None:
XenClient().remove_network_bridges(**vm.xen_server**, request.user, course_id, vm_id)
XenClient().stop_vm(started_vm['xen_server'], request.user, course_id, vm_id)
return redirect('/courses/' + course_id + '/vms?message=Unable to start VM - ' + vm.name)
The text was updated successfully, but these errors were encountered:
I just tried launching a standalone VM and connecting to it via VNC, and it is working(kali-test), so looks like something wrong with the course side logic.
Yep, and this is the point. If the course is working properly, this exception is never triggered and it is brushed under the carpet. But if the course config is ruined, it raises an exception, handling which includes a bad line I am talking about
Not critical, just code cleanliness.
I have managed to somehow ruin my test course (ironically, named 'The Best Course') and triggered an exception we maybe did not get in a while. In handling that exception we are referencing a missing attribute:
Unexpected error I have noticed:
File "/home/vital/vital2.0/source/virtual_lab/vital_site/vital/views/student_view.py", line 198, in start_vm
XenClient().remove_network_bridges(vm.xen_server, request.user, course_id, vm_id)
AttributeError: 'Virtual_Machine' object has no attribute 'xen_server'
Code triggering error:
The text was updated successfully, but these errors were encountered: