leapp-repository/0065-load-data-files-do-not-try-to-download-data-files-wh.patch
Petr Stodulka 0d3570809e RHEL 8.10: CTC2 candidate -1
- Do not try to download data files anymore when missing as the service
  is obsoleted since the data is part of installed packages
- Update error messages and reports when installed upgrade data files
  are malformed or missing to instruct user how to resolve it
- Update the leapp upgrade data files - bump data stream to "3.0"
- Resolves: RHEL-18298
2024-01-19 16:28:03 +01:00

50 lines
2.4 KiB
Diff

From a9e48f836e3bcc4e89f26c25a94b35195db2c043 Mon Sep 17 00:00:00 2001
From: Petr Stodulka <pstodulk@redhat.com>
Date: Wed, 23 Aug 2023 12:04:05 +0200
Subject: [PATCH 65/66] load data files: do not try to download data files when
missing
As the leapp upgrade data files are nowadays part of the install rpm,
there is no need to download them anymore. Also, we do not have any
plans to provide the updated data files anywhere out of the rpm.
From that point, do not try to download provided data files anymore.
---
repos/system_upgrade/common/libraries/fetch.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/repos/system_upgrade/common/libraries/fetch.py b/repos/system_upgrade/common/libraries/fetch.py
index 1ca26170..42fcb74c 100644
--- a/repos/system_upgrade/common/libraries/fetch.py
+++ b/repos/system_upgrade/common/libraries/fetch.py
@@ -20,6 +20,7 @@ def _get_hint():
rpmname = 'leapp-upgrade-el{}toel{}'.format(get_source_major_version(), get_target_major_version())
hint = (
'All official data files are nowadays part of the installed rpms.'
+ ' That is the only official resource of actual official data files for in-place upgrades.'
' This issue is usually encountered when the data files are incorrectly customized, replaced, or removed'
' (e.g. by custom scripts).'
' In case you want to recover the original file, remove it (if still exists)'
@@ -33,7 +34,9 @@ def _raise_error(local_path, details):
"""
If the file acquisition fails in any way, throw an informative error to stop the actor.
"""
+ rpmname = 'leapp-upgrade-el{}toel{}'.format(get_source_major_version(), get_target_major_version())
summary = 'Data file {lp} is missing or invalid.'.format(lp=local_path)
+
raise StopActorExecutionError(summary, details={'details': details, 'hint': _get_hint()})
@@ -174,7 +177,7 @@ def load_data_asset(actor_requesting_asset,
try:
# The asset family ID has the form (major, minor), include only `major` in the URL
- raw_asset_contents = read_or_fetch(asset_filename, data_stream=data_stream_major)
+ raw_asset_contents = read_or_fetch(asset_filename, data_stream=data_stream_major, allow_download=False)
asset_contents = json.loads(raw_asset_contents)
except ValueError:
msg = 'The {0} file (at {1}) does not contain a valid JSON object.'.format(asset_fulltext_name, asset_filename)
--
2.43.0