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

Open
erinn opened this Issue Mar 25, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.