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

drop dnf_options from P::P::Update #845

Merged
merged 1 commit into from
May 6, 2024
Merged
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
2 changes: 0 additions & 2 deletions definitions/procedures/packages/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion definitions/scenarios/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion lib/foreman_maintain/concerns/system_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions lib/foreman_maintain/package_manager/apt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions lib/foreman_maintain/package_manager/dnf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading