Skip to content

Commit

Permalink
BZ2188239 - enhance messaging around movement of data
Browse files Browse the repository at this point in the history
or the absence of it
  • Loading branch information
evgeni committed Apr 24, 2023
1 parent d537f36 commit 3c297e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ def satellite_upgrade_check(facts):
title = "Satellite PostgreSQL data migration"
flags = []
severity = reporting.Severity.MEDIUM
intro_msg = "PostgreSQL on RHEL 8 expects its data in /var/lib/pgsql/data."
reindex_msg = textwrap.dedent("""
After the data has been moved to the new location, all databases will require a REINDEX.
This will happen automatically during the first boot of the system.
PostgreSQL on RHEL 8 requires a rebuild of all database indexes, when using data created on RHEL 7.
This REINDEX will happen automatically during the first boot of the system.
""").strip()

if not facts.postgresql.scl_pgsql_data:
migration_msg = "Your PostgreSQL data seems to be already migrated."
migration_msg = """
Your PostgreSQL data seems to be already migrated to the new location.
No further movement will be performed.
"""
elif facts.postgresql.same_partition:
migration_msg = "Your PostgreSQL data will be automatically migrated."
else:
Expand All @@ -50,7 +54,7 @@ def satellite_upgrade_check(facts):
so that the contents of {} are available in /var/lib/pgsql/data.
""".format(scl_psql_path, storage_message, scl_psql_path)

summary = "{}\n{}".format(textwrap.dedent(migration_msg).strip(), reindex_msg)
summary = "{}\n{}\n{}".format(intro_msg, textwrap.dedent(migration_msg).strip(), reindex_msg)

reporting.create_report([
reporting.Title(title),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ def test_no_old_data(monkeypatch):
assert reporting.create_report.called == 1

expected_title = 'Satellite PostgreSQL data migration'
expected_intro = 'PostgreSQL on RHEL 8 expects its data in /var/lib/pgsql/data.'

assert expected_title == reporting.create_report.report_fields['title']
assert expected_intro in reporting.create_report.report_fields['summary']


def test_migrated_data(monkeypatch):
Expand All @@ -41,8 +43,8 @@ def test_migrated_data(monkeypatch):
assert reporting.create_report.called == 1

expected_title = 'Satellite PostgreSQL data migration'
expected_summary = 'Your PostgreSQL data seems to be already migrated.'
expected_reindex = 'all databases will require a REINDEX'
expected_summary = 'Your PostgreSQL data seems to be already migrated to the new location.'
expected_reindex = 'PostgreSQL on RHEL 8 requires a rebuild of all database indexes'

assert expected_title == reporting.create_report.report_fields['title']
assert expected_summary in reporting.create_report.report_fields['summary']
Expand All @@ -59,7 +61,7 @@ def test_same_disk(monkeypatch):

expected_title = 'Satellite PostgreSQL data migration'
expected_summary = 'Your PostgreSQL data will be automatically migrated.'
expected_reindex = 'all databases will require a REINDEX'
expected_reindex = 'PostgreSQL on RHEL 8 requires a rebuild of all database indexes'

assert expected_title == reporting.create_report.report_fields['title']
assert expected_summary in reporting.create_report.report_fields['summary']
Expand All @@ -77,7 +79,7 @@ def test_different_disk_sufficient_storage(monkeypatch):

expected_title = 'Satellite PostgreSQL data migration'
expected_summary = 'You currently have enough free storage to move the data'
expected_reindex = 'all databases will require a REINDEX'
expected_reindex = 'PostgreSQL on RHEL 8 requires a rebuild of all database indexes'

assert expected_title == reporting.create_report.report_fields['title']
assert expected_summary in reporting.create_report.report_fields['summary']
Expand Down

0 comments on commit 3c297e9

Please sign in to comment.