Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rhsm_repo disable does not support wildcard #8323

Closed
erinn opened this issue Mar 25, 2019 · 1 comment · Fixed by #8794
Closed

rhsm_repo disable does not support wildcard #8323

erinn opened this issue Mar 25, 2019 · 1 comment · Fixed by #8794
Labels
Type: Bug Does not work as expected.

Comments

@erinn
Copy link

erinn commented Mar 25, 2019

Description

The rhsm_repo resource which is a wrapper for subscription-manager repo does in fact support wildcards:

only_if { repo_enabled?(new_resource.repo_name) }

However due to the not_if never matching '*' it does not work:

only_if { repo_enabled?(new_resource.repo_name) }

So either '' should be caught and an exception raised, or '' should work (as it does from the command line) with the not_if. I would prefer that * works, just my opinion on the matter.

Chef Version

I am using 14.2, but this is current in master

Platform Version

RHEL 7, but it doesn't matter

Replication Case

rhsm_repo '*' do
action :disable
end

Though it will appear to work, it is actually a failure:

* rhsm_repo[*] action disable
           * execute[Enable repository *] action run/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/resource/rhsm_repo.rb:58: warning: nested repeat operator '+' and '*' was replaced with '*' in regular expression: /Repo ID:\s+*$/
        (skipped due to only_if)
            (up to date)

Client Output

Given above, but given again:

* rhsm_repo[*] action disable
           * execute[Enable repository *] action run/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/resource/rhsm_repo.rb:58: warning: nested repeat operator '+' and '*' was replaced with '*' in regular expression: /Repo ID:\s+*$/
        (skipped due to only_if)
            (up to date)
@lock
Copy link

lock bot commented Aug 21, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants