foreman_maintain 1.6.3 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b13b3b3d17ba932466b1bee7b2de56dd7a83bb577236d8fba67dcd04674f595
4
- data.tar.gz: 9f691170e95c2fbefb77db6218216b5d6dc0ec43d33fe4ca20dc84866f6dfd02
3
+ metadata.gz: dc4310d22dcb14b51945e3642cba4c7050e6660893dc09639064b013a2881380
4
+ data.tar.gz: d305fc1da3bd0a013d4455ec1ae578f22529fe5302261f82be251be5a0ee9a84
5
5
  SHA512:
6
- metadata.gz: 20e3f6408c0263c62a3bb2b11226f6d87bf6325fd5c14c980e0ca00af7375301e9d342700b400e4c4dca4915a14bac4cc68e006fea17ef5f6fa28120a2890987
7
- data.tar.gz: 338362b5bbf7c82cd43ec5d20e18c15435a5c122b3d7d4a6c1c6e5cc99e7c795312ead32af13f94fbacd78a877d323396e602df6058b69e4e3256d14cad8f592
6
+ metadata.gz: d10f290659e20460fffcebf72291e7260a6caf3c8d0964bdb3bd40d9f86ec9b8a5f70781c2f9de2d01778f09bdcda1421defb679a7f541d7ff4b21406368ca3c
7
+ data.tar.gz: c63898eece400b9d3813e06e070a3188c27ad5a06aaf57652c68e6f0887bf5b9173b6dd6eb9192acf37dff6b8d2b4c89285f65cf427de72a7a1aa69cc4b9f703
@@ -13,10 +13,9 @@ module Procedures::Packages
13
13
  "It is recommended to update everything only as part of upgrade\n" \
14
14
  "of the #{feature(:instance).product_name} to the next version. \n" \
15
15
  "To Upgrade to next version use 'foreman-maintain upgrade'.\n\n" \
16
- "NOTE: --assumeyes is not applicable for this check\n\n" \
17
16
  "Do you want to proceed with update of everything regardless\n" \
18
17
  'of the recommendations?'
19
- answer = ask_decision(question, actions_msg: 'y(yes), q(quit)', ignore_assumeyes: true)
18
+ answer = ask_decision(question, actions_msg: 'y(yes), q(quit)')
20
19
  abort! unless answer == :yes
21
20
  end
22
21
  end
@@ -97,25 +97,47 @@ module ForemanMaintain::Scenarios
97
97
  description 'update packages in unlocked session'
98
98
  param :packages, 'List of packages to Update', :array => true
99
99
  param :assumeyes, 'Do not ask for confirmation'
100
+ param :downloadonly, 'Download and cache packages'
100
101
  manual_detection
101
102
  end
102
103
 
104
+ # rubocop:disable Metrics/MethodLength
103
105
  def compose
104
106
  if Packages.skip_installer_run?(context.get(:packages))
105
107
  add_step_with_context(Procedures::Packages::Update,
106
108
  :force => true, :warn_on_errors => true)
107
109
  else
108
- add_steps_with_context(
109
- Procedures::Packages::UpdateAllConfirmation,
110
- Procedures::Packages::InstallerConfirmation
111
- )
110
+ unless context.get(:downloadonly)
111
+ add_steps_with_context(
112
+ Procedures::Packages::UpdateAllConfirmation,
113
+ Procedures::Packages::InstallerConfirmation
114
+ )
115
+ end
116
+
112
117
  add_step_with_context(Procedures::Packages::UnlockVersions)
113
- add_step_with_context(Procedures::Packages::Update,
114
- :force => true, :warn_on_errors => true)
115
- add_step_with_context(Procedures::Installer::Run)
118
+
119
+ if context.get(:downloadonly)
120
+ add_step_with_context(
121
+ Procedures::Packages::Update,
122
+ :force => true,
123
+ :warn_on_errors => true,
124
+ :dnf_options => ['--downloadonly']
125
+ )
126
+ add_step_with_context(Procedures::Packages::LockVersions)
127
+ else
128
+ add_step_with_context(
129
+ Procedures::Packages::Update,
130
+ :force => true,
131
+ :warn_on_errors => true
132
+ )
133
+
134
+ add_step_with_context(Procedures::Installer::Run)
135
+ end
136
+
116
137
  add_step(Procedures::Packages::LockingStatus)
117
138
  end
118
139
  end
140
+ # rubocop:enable Metrics/MethodLength
119
141
 
120
142
  def set_context_mapping
121
143
  context.map(:packages,
@@ -1,8 +1,10 @@
1
+ import configparser
2
+ import os
3
+
1
4
  import dnf
2
5
  import dnf.exceptions
3
6
  from dnfpluginscore import _, logger
4
7
 
5
- import configparser
6
8
 
7
9
  PROTECT_COMMANDS = ('install', 'downgrade', 'reinstall', 'distro-sync', 'swap', 'upgrade', 'upgrade-minimal')
8
10
 
@@ -53,6 +55,8 @@ class ForemanProtector(dnf.Plugin):
53
55
  def sack(self):
54
56
  if self.cli is not None and self.cli.command._basecmd not in PROTECT_COMMANDS:
55
57
  return
58
+ if os.environ.get('LEAPP_IPU_IN_PROGRESS') is not None:
59
+ return
56
60
  whitelist_and_obsoletes = self._add_obsoletes()
57
61
  all_available_packages = self.base.sack.query().available()
58
62
  excluded_pkgs_query = all_available_packages.difference(whitelist_and_obsoletes)
@@ -55,12 +55,15 @@ module ForemanMaintain
55
55
  subcommand 'update', 'Update packages in an unlocked session' do
56
56
  interactive_option(['assumeyes'])
57
57
  parameter '[PACKAGES] ...', 'packages to update', :attribute_name => :packages
58
+ option '--downloadonly', :flag, 'Downloads and caches package updates only',
59
+ :default => false
58
60
 
59
61
  def execute
60
62
  run_scenarios_and_exit(
61
63
  Scenarios::Packages::Update.new(
62
64
  :packages => packages,
63
- :assumeyes => assumeyes?
65
+ :assumeyes => assumeyes?,
66
+ :downloadonly => @downloadonly
64
67
  )
65
68
  )
66
69
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.6.3'.freeze
2
+ VERSION = '1.6.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_maintain
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-09 00:00:00.000000000 Z
11
+ date: 2024-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp