ovirt_vm: Fix getting console parameter (#63325)
Previously if the ovirt_vm module was executed without graphical_console parameter, the task failed with "NoneType has no attribute 'get'". The problem was that we obtained the graphical_console by self.param('graphical_console', dict()), which returned None, in case graphical_console is not passed instead of empty dict. So we must change the line to self.param('graphical_console') or dict().
This commit is contained in:
parent
38d1025d58
commit
f2e5e6de23
1 changed files with 2 additions and 2 deletions
|
@ -1387,7 +1387,7 @@ class VmsModule(BaseModule):
|
|||
template = self.__get_template_with_version()
|
||||
cluster = self.__get_cluster()
|
||||
snapshot = self.__get_snapshot()
|
||||
display = self.param('graphical_console', dict())
|
||||
display = self.param('graphical_console') or dict()
|
||||
|
||||
disk_attachments = self.__get_storage_domain_and_all_template_disks(template)
|
||||
|
||||
|
@ -1592,7 +1592,7 @@ class VmsModule(BaseModule):
|
|||
|
||||
cpu_mode = getattr(entity.cpu, 'mode')
|
||||
vm_display = entity.display
|
||||
provided_vm_display = self.param('graphical_console', {})
|
||||
provided_vm_display = self.param('graphical_console') or dict()
|
||||
return (
|
||||
check_cpu_pinning() and
|
||||
check_custom_properties() and
|
||||
|
|
Loading…
Reference in a new issue