Skip to content

Conversation

mnasiadka
Copy link
Member

No description provided.

@mnasiadka mnasiadka marked this pull request as ready for review June 19, 2024 12:07
@mnasiadka mnasiadka requested a review from a team as a code owner June 19, 2024 12:07
jovial
jovial previously approved these changes Jun 19, 2024
@mnasiadka mnasiadka force-pushed the ubuntu_ovmf branch 2 times, most recently from 31b5909 to d0c1b90 Compare June 19, 2024 12:43
@mnasiadka mnasiadka merged commit 2d1d834 into master Jun 20, 2024
@mnasiadka mnasiadka deleted the ubuntu_ovmf branch June 20, 2024 10:40
vars:
is_efi: >-
(libvirt_vms | selectattr('state', 'defined')
| selectattr('state', 'equalto', 'absent') |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be rejectattr?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copy pasted the from L14, but you're right - we don't need to install ovmf if we only want to remove VMs (I would assume it's already installed then).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit tricky also because the default for state is present, but the first selectattr only looks for VMs with a state defined. I think you'd need to concatenate lists of state undefined and state = present. Or you could ignore this micro optimisation for the state.

is_efi: >-
(libvirt_vms | selectattr('state', 'defined')
| selectattr('state', 'equalto', 'absent') |
| selectattr('boot_firmware', 'equalto', 'efi')) | bool

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this fail if boot_firmware is not defined for a VM? Based on L58 it should be optional.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It hasn't failed in Gerrit change - https://review.opendev.org/c/openstack/kayobe/+/921660

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because that change sets boot_firmware :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, a lot of | default(something) ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants