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
Add URL detection for argument according prefix (RhBug:1472847) #898
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring of _checkEnabledRepo function does not reflect actual parameters of this function.
dnf/cli/commands/__init__.py
Outdated
@@ -91,6 +91,9 @@ def _checkEnabledRepo(base, possible_local_files=[]): | |||
for lfile in possible_local_files: | |||
if lfile.endswith(".rpm") and os.path.exists(lfile): | |||
return | |||
schemes = dnf.pycomp.urlparse.urlparse(lfile)[0] | |||
if schemes and schemes in ('http', 'ftp', 'file', 'https'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if schemes in ('http', 'ftp', 'file', 'https'):
should be enough
Also in variable schemes is only one scheme. Rename variable to singular "scheme"?
@rh-atomic-bot try |
Additionally it reduce calls for check of available of repos if filename is present. https://bugzilla.redhat.com/show_bug.cgi?id=1472847 Closes: #898 Approved by: <try>
💥 Test timed out |
Additionally it reduce calls for check of available of repos if filename is present. https://bugzilla.redhat.com/show_bug.cgi?id=1472847
@m-blaha Refactored according to your request. If you will approve PR I will request the merge. Thanks a lot. |
📌 Commit e0862bf has been approved by |
☀️ Test successful - status-papr |
Additionally it reduce calls for check of available of repos if filename is
present.
https://bugzilla.redhat.com/show_bug.cgi?id=1472847