Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/facter/rhsm_available_pools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_output(input)
end

def rhsm_available_pools
value = []
value = nil
begin
available = Facter::Core::Execution.execute(
'/usr/sbin/subscription-manager list --available',
Expand Down Expand Up @@ -73,7 +73,7 @@ def rhsm_available_pools
:rhsm_available_pools,
pool,
pools::CACHE_FILE,
)
) unless pool.nil?
pool
elsif cache.is_a? Array
cache
Expand Down
4 changes: 2 additions & 2 deletions lib/facter/rhsm_available_repos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module Facter::Util::RhsmAvailableRepos
module_function

def rhsm_available_repos
value = []
value = nil
begin
output = Facter::Core::Execution.execute(
'/usr/sbin/subscription-manager repos',
Expand Down Expand Up @@ -65,7 +65,7 @@ def rhsm_available_repos
repo = repos.rhsm_available_repos
Facter::Util::FacterCacheable.cache(
:rhsm_available_repos, repo, repos::CACHE_FILE
)
) unless repo.nil?
repo
elsif cache.is_a? Array
cache
Expand Down
4 changes: 2 additions & 2 deletions lib/facter/rhsm_disabled_pools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_output(input)
end

def rhsm_disabled_pools
value = []
value = nil
begin
consumed = Facter::Core::Execution.execute(
'/usr/sbin/subscription-manager list --consumed',
Expand Down Expand Up @@ -79,7 +79,7 @@ def rhsm_disabled_pools
pool = pools.rhsm_disabled_pools
Facter::Util::FacterCacheable.cache(
:rhsm_disabled_pools, pool, pools::CACHE_FILE
)
) unless pool.nil?
pool
elsif cache.is_a? Array
cache
Expand Down
6 changes: 2 additions & 4 deletions lib/facter/rhsm_disabled_repos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module Facter::Util::RhsmDisabledRepos
module_function

def rhsm_disabled_repos
value = []
value = nil
begin
reponame = ''
output = Facter::Core::Execution.execute(
Expand Down Expand Up @@ -61,8 +61,6 @@ def rhsm_disabled_repos
repos = Facter::Util::RhsmDisabledRepos
if Puppet.features.facter_cacheable?
Facter.add(:rhsm_disabled_repos) do
confine { File.exist? '/usr/sbin/subscription-manager' }
confine { Puppet.features.facter_cacheable? }
setcode do
# TODO: use another fact to set the TTL in userspace
# right now this can be done by removing the cache files
Expand All @@ -73,7 +71,7 @@ def rhsm_disabled_repos
repo = repos.rhsm_disabled_repos
Facter::Util::FacterCacheable.cache(
:rhsm_disabled_repos, repo, repos::CACHE_FILE
)
) unless repo.nil?
repo
elsif cache.is_a? Array
cache
Expand Down
4 changes: 2 additions & 2 deletions lib/facter/rhsm_enabled_pools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_output(input)
end

def rhsm_enabled_pools
value = []
value = nil
begin
consumed = Facter::Core::Execution.execute(
'/usr/sbin/subscription-manager list --consumed',
Expand Down Expand Up @@ -79,7 +79,7 @@ def rhsm_enabled_pools
pool = pools.rhsm_enabled_pools
Facter::Util::FacterCacheable.cache(
:rhsm_enabled_pools, pool, pools::CACHE_FILE
)
) unless pool.nil?
pool
elsif cache.is_a? Array
cache
Expand Down
4 changes: 2 additions & 2 deletions lib/facter/rhsm_enabled_repos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module Facter::Util::RhsmEnabledRepos
module_function

def rhsm_enabled_repos
value = []
value = nil
begin
reponame = ''
output = Facter::Core::Execution.execute(
Expand Down Expand Up @@ -71,7 +71,7 @@ def rhsm_enabled_repos
repo = repos.rhsm_enabled_repos
Facter::Util::FacterCacheable.cache(
:rhsm_enabled_repos, repo, repos::CACHE_FILE
)
) unless repo.nil?
repo
elsif cache.is_a? Array
cache
Expand Down
4 changes: 2 additions & 2 deletions lib/facter/rhsm_identity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#
# Report the name of the client ID.
# This will be null if the reigstration is bad.
# This will be null if the registration is bad.
#
# Copyright 2014-2015 Gaël Chamoulaud, James Laska
#
Expand Down Expand Up @@ -65,7 +65,7 @@ def rhsm_identity
identity = identities.rhsm_identity
Facter::Util::FacterCacheable.cache(
:rhsm_identity, identity, identities::CACHE_FILE
)
) unless identity.nil?
identity
elsif cache.is_a? Array
cache
Expand Down