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

Fix url parsing - rawhide port #234

Open
wants to merge 2 commits into
base: rawhide
Choose a base branch
from
Open
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
16 changes: 12 additions & 4 deletions org_fedora_oscap/content_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@ def content_uri(self):

@content_uri.setter
def content_uri(self, uri):
scheme, path = uri.split("://", 1)
self.content_uri_path = path
self.content_uri_scheme = scheme
scheme_and_maybe_path = uri.split("://")
if len(scheme_and_maybe_path) == 1:
msg = (
f"Invalid supplied content URL '{uri}', "
"use the 'scheme://path' form.")
raise KickstartValueError(msg)
self.content_uri_path = scheme_and_maybe_path[1]
self.content_uri_scheme = scheme_and_maybe_path[0]

def fetch_content(self, what_if_fail, ca_certs_path=""):
"""
Expand All @@ -87,7 +92,10 @@ def fetch_content(self, what_if_fail, ca_certs_path=""):
should handle them in the calling layer.
ca_certs_path: Path to the HTTPS certificate file
"""
self.content_uri = self._addon_data.content_url
try:
self.content_uri = self._addon_data.content_url
except Exception as exc:
what_if_fail(exc)
shutil.rmtree(self.CONTENT_DOWNLOAD_LOCATION, ignore_errors=True)
self.CONTENT_DOWNLOAD_LOCATION.mkdir(parents=True, exist_ok=True)
fetching_thread_name = self._fetch_files(
Expand Down
2 changes: 2 additions & 0 deletions org_fedora_oscap/gui/spokes/oscap.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ def update_progress_label(msg):
if self._policy_data.profile_id and not selected:
# profile ID given, but it was impossible to select it -> invalid
# profile ID given
with self._fetch_flag_lock:
self._fetching = False
self._invalid_profile_id()
return

Expand Down