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
Use zypper instead of yum #1041
Conversation
|
Can one of the admins verify this patch? |
1 similar comment
|
Can one of the admins verify this patch? |
| resolved = [] | ||
| failed = [] | ||
|
|
||
| # for t in ts_info: |
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.
Can this commented block be removed please.
| log.info('Progress [%s]:\n%s', self.steps, self.details) | ||
|
|
||
|
|
||
| # vim: set ts=4 sts=4 sw=4 et ai: |
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.
Can this be removed please?
| def update(self, names=()): | ||
| """ | ||
| Update installed packages. | ||
| When (names) is not specified, all packages are updated. |
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.
Would it be ok to separate the parameters from the docstring body with one line of whitespace. Here and similar elsewhere?
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.
It would be OK but the rpmtools_yum.py doesn't do that. Therefore I think it's better be similar to rpmtools_yum.py and let it as it is.
|
|
||
| def update(self, names=()): | ||
| """ | ||
| Update installed packages. |
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.
Can a line of whitespace be added after the first line for any multi-line docstring? That is part PEP 257 and makes it more readable.
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.
It would be OK but the rpmtools_yum.py doesn't do that. Therefore I think it's better be similar to rpmtools_yum.py and let it as it is.
|
|
||
| return result | ||
|
|
||
| def update_p(self, names, q): |
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 suspect this doesn't have a docstring because it's an internal method. If so, can it become a private method such as _update_p. All public methods should have docstrings.
| log.addHandler(ch) | ||
|
|
||
|
|
||
| class Zypp: |
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.
It would be great if we could get some more docstrings on these methods.
|
This is a great feature, can a few things be done to track it's addition to Pulp?
|
|
Can you ensure you are in the AUTHORS file? Also can the commits be squashed so there is only 1 commit? |
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.
@sbernhard Thank you so much for this pull request. I apologize it's gone unreviewed for so long. I want to help get it merged, so I left the things that need to be done. It's mostly documentation and docstrings, but check out the comments I left. If there are any questions or ideas please let me know so we can help. This is going to be a great addition for the community.
| # Now all installed and available items are in the pool: | ||
| log.debug("Known items: %d" % (self.Z.pool().size())) | ||
|
|
||
| def poolInstall(self, capstr): |
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.
What do these pool*() methods do?
|
|
||
| return result | ||
|
|
||
| def poolCommit(self, dryrun): |
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.
What does this do?
|
I noticed that these lines are repeated in several (7) places in this PR. Would you mind pulling this out into a documented helper method? |
|
|
||
| return result | ||
|
|
||
| def update_minimal(self, advisories=[]): |
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.
Default values should not be mutable. This will need to be changed in other places as well.
http://python-guide-pt-br.readthedocs.io/en/latest/writing/gotchas/#mutable-default-arguments
| result = None | ||
|
|
||
| # TODO: looks like that this is not necessary for "update_minimal". Only str() is required! | ||
| advisories = [str(x.replace('-*-*.*', '').replace('*:', '')) for x in advisories] |
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 noticed that these lines are repeated multiple times throughout this PR. Could they be pulled out into a separate helper method?
|
Can one of the admins verify this patch? |
Use zypper library instead of yum on SUSE based distributions.
The zypper library transactions are running within a separate process as the zypper application would otherwise be blocked as long as the gofer process is running. Looks like that this is a issue in zypper / python swig implementation. Answer from zypper development mailing list:
Older libzypp versions are not able to drop the lock at runtime.
(and they also don't have 'zypp.ZYppFactory_instance().haveZYpp()'
to test whether the instance is present.)
On older distros you need to run zypp in a separate process,
so libzypp gets unloaded and releases the lock.