diff --git a/definitions/procedures/packages/update.rb b/definitions/procedures/packages/update.rb index eddf4d13a..19ab9dbb6 100644 --- a/definitions/procedures/packages/update.rb +++ b/definitions/procedures/packages/update.rb @@ -6,7 +6,6 @@ class Update < ForemanMaintain::Procedure param :force, 'Do not skip if package is installed', :flag => true, :default => false param :warn_on_errors, 'Do not interrupt scenario on failure', :flag => true, :default => false - param :dnf_options, 'Extra dnf options if any', :array => true, :default => [] param :download_only, 'Download and cache packages only', :flag => true, :default => false param :clean_cache, 'If true will cause a DNF cache clean', :flag => true, :default => true end @@ -16,7 +15,6 @@ def run package_manager.clean_cache(:assumeyes => assumeyes_val) if @clean_cache opts = { :assumeyes => assumeyes_val, - :options => @dnf_options, :download_only => @download_only, } packages_action(:update, @packages, opts) diff --git a/definitions/scenarios/update.rb b/definitions/scenarios/update.rb index c9238676e..43a1c7ee6 100644 --- a/definitions/scenarios/update.rb +++ b/definitions/scenarios/update.rb @@ -59,7 +59,7 @@ def compose add_steps( Procedures::Packages::Update.new( :assumeyes => true, - :dnf_options => ['--downloadonly'] + :download_only => true ), Procedures::MaintenanceMode::EnableMaintenanceMode, Procedures::Crond::Stop, diff --git a/lib/foreman_maintain/concerns/system_helpers.rb b/lib/foreman_maintain/concerns/system_helpers.rb index 416dcba82..22813ea90 100644 --- a/lib/foreman_maintain/concerns/system_helpers.rb +++ b/lib/foreman_maintain/concerns/system_helpers.rb @@ -108,7 +108,6 @@ def packages_action(action, packages, options = {}) package_manager.update( packages, :assumeyes => options[:assumeyes], - :options => options[:options], :download_only => options[:download_only] ) when :remove diff --git a/lib/foreman_maintain/package_manager/apt.rb b/lib/foreman_maintain/package_manager/apt.rb index d56d9541b..345859a31 100644 --- a/lib/foreman_maintain/package_manager/apt.rb +++ b/lib/foreman_maintain/package_manager/apt.rb @@ -19,12 +19,10 @@ def remove(packages, assumeyes: false) apt_action('remove', packages, :assumeyes => assumeyes) end - # rubocop:disable Lint/UnusedMethodArgument - def update(packages = [], assumeyes: false, options: [], download_only: false) + def update(packages = [], assumeyes: false, download_only: false) action = packages.any? ? '--only-upgrade install' : 'upgrade' apt_action(action, packages, :assumeyes => assumeyes, :download_only => download_only) end - # rubocop:enable Lint/UnusedMethodArgument def clean_cache(assumeyes: false) apt_action('clean', [], :assumeyes => assumeyes) diff --git a/lib/foreman_maintain/package_manager/dnf.rb b/lib/foreman_maintain/package_manager/dnf.rb index 8efd28458..b7bcdee21 100644 --- a/lib/foreman_maintain/package_manager/dnf.rb +++ b/lib/foreman_maintain/package_manager/dnf.rb @@ -59,12 +59,11 @@ def remove(packages, assumeyes: false) dnf_action('remove', packages, assumeyes: assumeyes) end - def update(packages = [], assumeyes: false, options: [], download_only: false) + def update(packages = [], assumeyes: false, download_only: false) dnf_action( 'update', packages, assumeyes: assumeyes, - dnf_options: options, download_only: download_only ) end