-
Notifications
You must be signed in to change notification settings - Fork 13
Add srpm source location #279
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
Conversation
|
@ehelms would you mind rebasing and fixing the " C: 59, 0: Missing function or method docstring (missing-function-docstring)" pylint error? |
9e2c239 to
94e3d69
Compare
evgeni
left a comment
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.
comments on the python code, but happy with the overall "this is how it shall work in obal"
variable names are fine too
f7c0dc3 to
b2c627a
Compare
b2c627a to
a99f3d9
Compare
|
To get python 2.7 I had to change my approach and dance around with urllib being different in Py2 and Py3. |
obal/data/modules/srpm.py
Outdated
| try: | ||
| from urllib.request import urlopen | ||
| from urllib.error import HTTPError | ||
| except ImportError: | ||
| from urllib2 import urlopen, HTTPError |
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.
| """ | ||
| Copy RPM sources from a remote source like Jenkins to rpmbuild environment | ||
| """ | ||
| source_system_urls = { |
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.
I thought more of a global, static var (SOURCE_SYSTEM_URLS), but wouldn't mind either way here.
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.
I was worried about scope creep, and I figured if I went this route and there was a reason to go with a global static variable you'd point it out to me :)
| } | ||
|
|
||
| url = source_system_urls[source_system].format(source_location) | ||
| request = urlopen(url) |
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.
Ansible has open_url, fetch_url and fetch_file in https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/urls.py which could be used instead, but I don't think we buy anything by using them here.
evgeni
left a comment
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.
left a few comments what could be done differently without really thinking it'd be better ;-)
a99f3d9 to
d6e27d7
Compare
d6e27d7 to
b3d49ec
Compare
This fills a gap in the srpm.py module that was added a few months back. A source location and source type can now be specified that will download sources into the buildroot. This mimcs the behavior that tito used to provide in this area and is focused on supporting our primary use of downloading nightly sources from Jenkins. This will require changes to the package manifest to support it:
Note the last two new parameters. I am not sold on the naming convention of the variables, so feel free to offer new ideas. The tito arguments will have to remain for a period of time as those are still used by the koji build functionality (#230 aims to close that gap).
This is built on top of #278 which touches the same file.