class Chef::Resource::RhsmRepo

Public Instance Methods

repo_enabled?(repo) click to toggle source
# File lib/chef/resource/rhsm_repo.rb, line 68
def repo_enabled?(repo)
  # FIXME: use shell_out()
  cmd = Mixlib::ShellOut.new("subscription-manager repos --list-enabled", env: { LANG: "en_US" })
  cmd.run_command
  repo == "*" || !cmd.stdout.match(/Repo ID:\s+#{repo}$/).nil?
end