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

Add support to list future subscription pools #200

Closed
wants to merge 1 commit into from

Conversation

tumido
Copy link

@tumido tumido commented Apr 14, 2017

Implementing API addition based on Candlepin bug 1414426 and API spec. This functionality is available since Candlepin 2.0.24 (backported to the 0.9.51.21)

It allows user to list future pools via getPoolsList() method of the UEPConnection class. This PR is introducing a new parameter future, which can be either None, "add" or "only" according to how the future pools should be listed.

Possible values:

  • None - there's not change in behavior.
  • 'add' - the add_future=true param is added to the GET call.
  • 'only' - API is called with only_future=true param in the query.

This work flow is using rather one param than two separate (used by API). This is used because that only_future and add_future flags are mutually exclusive, when it comes to it's behavior. If it should be rewritten to fully respect the original API call, please let me know. If any test or documentation should be updated according to this change, let me know as well.

Implementing API addition based on Candlepin bug 1414426 [1] and API spec [2].
This functionality is available since Candlepin 2.0.24 (backported to the
0.9.51.21)

Possible values of `future` parameter:
- `None` - there's not change in behavior.
- `'add'` - the `add_future=true` param is added to the GET call.
- `'only'` - API is called with `only_future=true` param in the query.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1414426
[2] http://www.candlepinproject.org/swagger/?url=candlepin/swagger-2.0.25.json#!/owners/listPools
@jirihnidek
Copy link

@tumido I have to repeat information from main page of this project: "All new development is in candlepin/subscription-manager". Please recreate this PR for this repository: https://github.com/candlepin/subscription-manager, because all development of python-rhsm is done in subscription-manager repository. Thanks.

@tumido
Copy link
Author

tumido commented Apr 16, 2017

@jirihnidek Ok then. Sorry, It was a bit misleading to me at a first glance. I will resubmit it there.

Since you've started about it, a quick offtopic question: In order to use latest python-rhsm is it required to clone the whole subscription-manager repository now? That's nearly 40 MB of code vs 1 MB when cloning the python-rhsm. That's very inconvenient and slow. I was not able to find any other way, how to install python-rhsm into a Python virtual environment or when building a Docker image, etc. Do you know about any more convenient mean of getting up-to-date python-rhsm?

@barnabycourt
Copy link
Contributor

Closing this PR as it has been resubmitted against candlepin/subscription-manager#1588 since this repository is no longer used.

@kahowell
Copy link
Contributor

@tumido, also, looking into your question about getting latest python-rhsm, you could do shallow clone: git clone https://github.com/candlepin/subscription-manager. If you don't care about history, it's a decent way to save some bandwidth. It still comes in at ~13M though at the time of writing. You could also use source RPMs which are still small (looking at a test one of ~152K right now).

@tumido
Copy link
Author

tumido commented Apr 17, 2017

@kahowell Hm.. That could be a way, though it's not possible to do so using pip (unfortunately pip has git support for downloading whole repository only as far as I know). I've currently solved this by instead of:

requirements.txt:
    git+git://github.com/candlepin/python-rhsm.git

using this:

requirements.txt:
    [email protected]:candlepin/subscription-manager.git@master#egg=rhsm&subdirectory=python-rhsm

Which still downloads whole repository, though it can install the package just fine. Using the RPM is not suitable for non Fedora/RHEL devel enviroments and nonroot, virtualenv install only.

I'm gonna look into the source RPMs closer though, it might be a way when used with some wrappers. Thanks!

@tumido
Copy link
Author

tumido commented Apr 18, 2017

FYI, pip just currently closed their issue (pypa/pip#2432) about shallow clones of git repositories. In my eyes, the best approach would be to have python-rhsm published on PyPI as a standard Python package. I know, it's easier to say than do so (and in the end to test it and maintain it). I can't tell, how many users would benefit from it and if it is actually worth investing your time and effort. It's an option, it's up to you to consider it. ;) In the end, it's not that big a deal.

@tumido
Copy link
Author

tumido commented Apr 19, 2017

I found out that it's possible to use pip to pull a Git repo from GitHub as SVN, which saves a lot of space. I've kicked of a discussion (candlepin/subscription-manager#1591) so there's no need to track this pull request anymore.

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.

4 participants