The Subscription Manager package provides programs and libraries to allow users to manage subscriptions and yum repositories from the Candlepin.
- http://candlepinproject.org/
- https://fedorahosted.org/subscription-manager/
- https://github.com/candlepin/subscription-Manager
In order to build, develop, and test locally, please follow instructions at candlepinproject.org.
For instructions on building the debian-packages of this project, see instructions in contrib/debian/README.source.
Due to unintuitive behavior with sys.path
(see https://github.com/asottile/scratch/wiki/PythonPathSadness),
python src/subscription_manager/scripts/subscription_manager.py
does not work
as expected. One can run the script like this instead:
PYTHONPATH=./src python -m subscription_manager.scripts.subscription_manager
Similar for other bin scripts:
PYTHONPATH=./src python -m subscription_manager.scripts.rct
# ... etc.
(You can also just export PYTHONPATH
instead of setting it in each command).
To ignore bulk commits that only change the format of the code, not the code
itself (e.g. black
ing whole codebase), add .git-blame-ignore-revs
to your
git configuration:
git config blame.ignoreRevsFile .git-blame-ignore-revs
There is experimental support for installation of subscription-manager using Pipenv. We tested installing subscription-manager using Pipenv only on following operating systems:
- Fedora 30
- RHEL/CentOS 7
- RHEL/CentOS 8
We tested pipenv with Python 2 and Python 3. It is necessary to install following packages to your system, because binary module have to be compiled in virtual environment:
dnf install -y pipenv gcc make python2-devel \
openssl-devel libnl3-devel
dnf install -y pipenv gcc make python3-devel \
openssl-devel libnl3-devel
You can create virtual environment using following steps:
-
Create virtual environment using Python 2 or Python 3 and it is necessary to use
--site-packages
argument, because virtual environment has to userpm
Python package installed in your system. It is not possible to installrpm
Python package to virtual environment using pip/pipenv.Python 2:
pipenv --site-packages --two
Python 3:
pipenv --site-packages --three
-
Install required Python packages defined in
Pipfile
into virtual environment:pipevn install
-
Start virtual environment:
pipenv shell
-
Build binary modules in virtual environment:
python ./setup.py build
-
Install subscription-manager into virtual environment:
python ./setup.py install
-
It should be possible to run subscription-manager in virtual environment
sudo subscription-manager version
The Ansible role that is used for deploying subscription-manager can be found at https://github.com/candlepin/ansible-role-subman-devel. In order to test changes for this Ansible role you will need to check it out locally. This will pull the latest commit from this path and use it for deployment.
We run tests using pytest. See TESTING.md for more details.