Skip to content

Conversation

kubaw
Copy link
Contributor

@kubaw kubaw commented Sep 12, 2019

I think checking condition like this: rvm1_rubies | bool doesn't work for array. It is always false.
This causes an error:

"stderr": "/bin/sh: /home/user/.rvm/wrappers//gem: not found"

Looks like checking using | length works for arrays but it is also works for strings.

Kulgar
Kulgar previously approved these changes Jun 18, 2020
@pkuczynski pkuczynski changed the title fix boolean values when checking array Fix boolean values when checking array Jul 21, 2020
@pkuczynski pkuczynski requested a review from a team as a code owner July 21, 2020 09:44
@pkuczynski
Copy link
Member

@kubaw thank you for your contribution and apologies for the late merge. I will invite you to the RVM team so you can have better influence on this package...

@pkuczynski pkuczynski merged commit 08ed7fe into rvm:master Jul 21, 2020
@pkuczynski pkuczynski added the bug label Jul 21, 2020
@rien rien mentioned this pull request Jul 21, 2020
@thbar
Copy link
Contributor

thbar commented Jul 27, 2020

@rvm/ansible I have tested this PR successfully on a client deployment.

Not only the warnings disappears, but #209 also appears to be closed (I'll comment over there).

Logs before:

TASK [rvm.ruby : Detect if rubies are installed] ************************************************************
[DEPRECATION WARNING]: evaluating ['ruby-2.5.8', 'ruby-2.5.7', 'ruby-2.5.3'] as a bare variable, this 
behaviour will go away and you might need to add |bool to the expression in the future. Also see 
CONDITIONAL_BARE_VARS configuration toggle.. This feature will be removed in version 2.12. Deprecation 
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
skipping: [vagrant-xyz] => (item=ruby-2.5.8) 
skipping: [vagrant-xyz] => (item=ruby-2.5.7) 
skipping: [vagrant-xyz] => (item=ruby-2.5.3) 

Logs after:

TASK [rvm.ruby : Detect if rubies are installed] ************************************************************
skipping: [vagrant-xyz] => (item=ruby-2.5.8) 
skipping: [vagrant-xyz] => (item=ruby-2.5.7) 
skipping: [vagrant-xyz] => (item=ruby-2.5.3) 

Thanks @kubaw!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants