Skip to content

Commit

Permalink
rename has_katello_installer to installer_has_systemchecks
Browse files Browse the repository at this point in the history
as even the katello installer dropped this at some point
  • Loading branch information
evgeni committed Feb 22, 2024
1 parent be261cd commit 0773e0f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def process(self):
api.current_logger().error('Failed to reindex the database: {}'.format(str(e)))

installer_cmd = ['foreman-installer']
if facts.has_katello_installer:
if facts.installer_has_systemchecks:
installer_cmd.append('--disable-system-checks')

api.current_actor().show_message('Running the installer. This can take a while.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_run_installer(monkeypatch, current_actor_context):
def test_run_installer_without_katello(monkeypatch, current_actor_context):
mocked_run = MockedRun()
monkeypatch.setattr('leapp.libraries.stdlib.run', mocked_run)
current_actor_context.feed(SatelliteFacts(has_foreman=True, has_katello_installer=False,
current_actor_context.feed(SatelliteFacts(has_foreman=True, installer_has_systemchecks=False,
postgresql=SatellitePostgresqlFacts(local_postgresql=False)))
current_actor_context.run()
assert mocked_run.commands
Expand Down
4 changes: 2 additions & 2 deletions repos/system_upgrade/common/models/satellite.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SatelliteFacts(Model):

has_foreman = fields.Boolean(default=False)
"""Whether or not foreman is installed on this system"""
has_katello_installer = fields.Boolean(default=True)
"""Whether or not the installer supports Katello additions"""
installer_has_systemchecks = fields.Boolean(default=True)
"""Whether or not the installer supports --disable-system-checks flag"""
postgresql = fields.Model(SatellitePostgresqlFacts)
""" Foreman related PostgreSQL facts """
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def process(self):
if not has_foreman:
return

has_katello_installer = has_package(InstalledRPM, 'foreman-installer-katello')
installer_has_systemchecks = has_package(InstalledRPM, 'foreman-installer-katello')

local_postgresql = has_package(InstalledRPM, 'rh-postgresql12-postgresql-server')
postgresql_contrib = has_package(InstalledRPM, 'rh-postgresql12-postgresql-contrib')
Expand Down Expand Up @@ -126,7 +126,7 @@ def process(self):

self.produce(SatelliteFacts(
has_foreman=has_foreman,
has_katello_installer=has_katello_installer,
installer_has_systemchecks=installer_has_systemchecks,
postgresql=SatellitePostgresqlFacts(
local_postgresql=local_postgresql,
old_var_lib_pgsql_data=old_pgsql_data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ def test_no_katello_installer_present(current_actor_context):
current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM]))
current_actor_context.run(config_model=mock_configs.CONFIG)
message = current_actor_context.consume(SatelliteFacts)[0]
assert not message.has_katello_installer
assert not message.installer_has_systemchecks


def test_katello_installer_present(current_actor_context):
current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM, KATELLO_INSTALLER_RPM]))
current_actor_context.run(config_model=mock_configs.CONFIG)
message = current_actor_context.consume(SatelliteFacts)[0]
assert message.has_katello_installer
assert message.installer_has_systemchecks


def test_enables_ruby_module(current_actor_context):
Expand Down

0 comments on commit 0773e0f

Please sign in to comment.