Closed kbrock closed 2 months ago
Part of https://github.com/ManageIQ/manageiq/pull/22898 (as a followup) Introduced by https://github.com/ManageIQ/manageiq-providers-vmware/pull/901
Return from a block behaves in strange ways. What we wanted is to return that value from the block (aka, acted like it is a proc)
Solution is to change the order of the if block so we can avoid supports? and avoid setting a variable. (and obviously, avoiding the bad return)
ERROR -- evm: [LocalJumpError]: unexpected return Method:[block (2 levels) in <class:LogProxy>] ERROR -- evm: manageiq-providers-vmware/app/models/manageiq/providers/vmware/infra_manager/vm/operations/guest.rb:20: in `block (2 levels) in <module:Guest>' manageiq/app/models/mixins/supports_feature_mixin.rb:113:in `instance_eval' manageiq/app/models/mixins/supports_feature_mixin.rb:113:in `check_supports' manageiq/app/models/mixins/supports_feature_mixin.rb:71:in `supports?'
Checked commit https://github.com/kbrock/manageiq-providers-vmware/commit/2855abb7bbe8a504439b28f70d1f395e08d7a18a with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint 1 file checked, 0 offenses detected Everything looks fine. :star:
Part of https://github.com/ManageIQ/manageiq/pull/22898 (as a followup) Introduced by https://github.com/ManageIQ/manageiq-providers-vmware/pull/901
Return from a block behaves in strange ways. What we wanted is to return that value from the block (aka, acted like it is a proc)
Solution is to change the order of the if block so we can avoid supports? and avoid setting a variable. (and obviously, avoiding the bad return)
Error