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

Use zypper instead of yum #1041

Closed
wants to merge 0 commits into from
Closed

Use zypper instead of yum #1041

wants to merge 0 commits into from

Conversation

sbernhard
Copy link

@sbernhard sbernhard commented Mar 20, 2017

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.

@pulpbot
Copy link
Member

pulpbot commented Mar 20, 2017

Can one of the admins verify this patch?

1 similar comment
@pulpbot
Copy link
Member

pulpbot commented Mar 20, 2017

Can one of the admins verify this patch?

resolved = []
failed = []

# for t in ts_info:
Copy link
Member

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:
Copy link
Member

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.
Copy link
Member

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?

Copy link
Author

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.
Copy link
Member

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.

Copy link
Author

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):
Copy link
Member

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:
Copy link
Member

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.

@bmbouter
Copy link
Member

This is a great feature, can a few things be done to track it's addition to Pulp?

  • Create a Redmine Story describing what it does for Pulp RPM. That can be filed here.
  • Redo the commit so that it references the issue you make ^. Here are docs on what that looks like.
  • Add documentation somehow documenting this capability being added to pulp_rpm. The docs are here and compile with make clean;make html.
  • Add a release note for the feature. If we can merge it before 2.14 becomes a beta then add those release notes to the 2.14. The 2.14 release schedule is here.

@bmbouter
Copy link
Member

Can you ensure you are in the AUTHORS file? Also can the commits be squashed so there is only 1 commit?

Copy link
Member

@bmbouter bmbouter left a 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):
Copy link
Member

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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

@dralley
Copy link
Contributor

dralley commented Jun 19, 2017

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?

# TODO: looks like that this is not necessary for package groups. Only str() is required!
names = [str(x.replace('-*-*.*', '').replace('*:', '')) for x in names]

@dralley dralley self-requested a review June 19, 2017 14:06

return result

def update_minimal(self, advisories=[]):
Copy link
Contributor

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]
Copy link
Contributor

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?

@pulpbot
Copy link
Member

pulpbot commented Jun 21, 2017

Can one of the admins verify this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants