Module: ForemanMaintain::Concerns::PrimaryChecks

Included in:
ForemanMaintain
Defined in:
lib/foreman_maintain/concerns/primary_checks.rb

Instance Method Summary collapse

Instance Method Details

#package_nameObject



13
14
15
16
17
18
19
20
# File 'lib/foreman_maintain/concerns/primary_checks.rb', line 13

def package_name
  installed_scenario = detector.feature(:installer).last_scenario
  if installed_scenario == 'satellite'
    'satellite'
  elsif installed_scenario == 'capsule'
    'satellite-capsule'
  end
end

#validate_downstream_packagesObject



4
5
6
7
8
9
10
11
# File 'lib/foreman_maintain/concerns/primary_checks.rb', line 4

def validate_downstream_packages
  return unless detector.feature(:installer) && detector.feature(:installer).with_scenarios?
  if (package = package_name) && !package_manager.installed?(package)
    raise ForemanMaintain::Error::Fail,
          "Error: Important rpm package #{package} is not installed!"\
          "\nInstall #{package} rpm to ensure system consistency."
  end
end