A GUI and CLI client for Candlepin
Switch branches/tags
subscription-manager-1.24.1-1 subscription-manager-1.24.0-1 subscription-manager-1.23.4-1 subscription-manager-1.23.3-1 subscription-manager-1.23.2-1 subscription-manager-1.23.1-1 subscription-manager-1.22.1-1 subscription-manager-1.22.0-1 subscription-manager-1.21.5-1 subscription-manager-1.21.4-3 subscription-manager-1.21.4-2 subscription-manager-1.21.4-1 subscription-manager-1.21.3-1 subscription-manager-1.21.2-3 subscription-manager-1.21.2-2 subscription-manager-1.21.2-1 subscription-manager-1.21.1-1 subscription-manager-1.20.9-1 subscription-manager-1.20.8-1 subscription-manager-1.20.7-1 subscription-manager-1.20.6-1 subscription-manager-1.20.5-1 subscription-manager-1.20.4-1 subscription-manager-1.20.3-1 subscription-manager-1.20.2-1 subscription-manager-1.20.1-1 subscription-manager-1.20.0-1 subscription-manager-1.19.23-1 subscription-manager-1.19.22-1 subscription-manager-1.19.21-1 subscription-manager-1.19.20-1 subscription-manager-1.19.19-1 subscription-manager-1.19.18-1 subscription-manager-1.19.17-1 subscription-manager-1.19.16-1 subscription-manager-1.19.15-1 subscription-manager-1.19.14-1 subscription-manager-1.19.13-1 subscription-manager-1.19.12-1 subscription-manager-1.19.11-1 subscription-manager-1.19.10-1 subscription-manager-1.19.9-1 subscription-manager-1.19.8-1 subscription-manager-1.19.7-1 subscription-manager-1.19.6-1 subscription-manager-1.19.5-1 subscription-manager-1.19.4-1 subscription-manager-1.19.3-1 subscription-manager-1.19.2-1 subscription-manager-1.19.1-1 subscription-manager-1.19.0-1 subscription-manager-1.18.10-1 subscription-manager-1.18.9-1 subscription-manager-1.18.8-1 subscription-manager-1.18.7-1 subscription-manager-1.18.6-1 subscription-manager-1.18.5-1 subscription-manager-1.18.4-1 subscription-manager-1.18.3-1 subscription-manager-1.18.2-1 subscription-manager-1.18.1-1 subscription-manager-1.17.15-1 subscription-manager-1.17.14-1 subscription-manager-1.17.13-1 subscription-manager-1.17.12-1 subscription-manager-1.17.11-1 subscription-manager-1.17.10-1 subscription-manager-1.17.9-1 subscription-manager-1.17.8-1 subscription-manager-1.17.7-1 subscription-manager-1.17.6-1 subscription-manager-1.17.5-1 subscription-manager-1.17.4-1 subscription-manager-1.17.3-1 subscription-manager-1.17.2-1 subscription-manager-1.17.1-1 subscription-manager-1.16.8-8 subscription-manager-1.16.8-7 subscription-manager-1.16.8-6 subscription-manager-1.16.8-5 subscription-manager-1.16.8-4 subscription-manager-1.16.8-3 subscription-manager-1.16.8-2 subscription-manager-1.16.8-1 subscription-manager-1.16.7-1 subscription-manager-1.16.6-1 subscription-manager-1.16.5-1 subscription-manager-1.16.4-1 subscription-manager-1.16.3-1 subscription-manager-1.16.2-1 subscription-manager-1.16.1-1 subscription-manager-1.16.0-1 subscription-manager-1.15.9-15 subscription-manager-1.15.9-14 subscription-manager-1.15.9-13 subscription-manager-1.15.9-12 subscription-manager-1.15.9-11 subscription-manager-1.15.9-10 subscription-manager-1.15.9-9 subscription-manager-1.15.9-8
Nothing to show
Clone or download
cnsnyder Merge pull request #1941 from candlepin/khowell/1637183
1637183: Replace redhat-uep.pem properly ENT-916
Latest commit 2a58430 Oct 16, 2018
Permalink
Failed to load latest commit information.
.tito Automatic commit of package [subscription-manager] release [1.24.1-1]. Oct 15, 2018
build_ext Move syspurpose out of packages directory. Jul 25, 2018
cockpit Cockpit/Syspurpose service integration fix Aug 8, 2018
docs Move python-rhsm build into subscription-manager Oct 30, 2017
etc-conf 1637183: Replace redhat-uep.pem properly Oct 15, 2018
example-plugins Import print_function, division, and absolute_import into all modules May 30, 2017
man Update man page for report_package_profile option Oct 15, 2018
playpen Move python-rhsm build into subscription-manager Oct 30, 2017
po 1618825: Rename de_DE.po and es_ES.po Sep 24, 2018
rel-eng Merge python-rhsm into subscription-manager repo Feb 23, 2017
scripts Remove other references to python-kitchen. Jul 24, 2018
src Merge pull request #1932 from candlepin/csnyder/1632248 Oct 15, 2018
syspurpose 1623390: Fix unregistered messaging in syspurpose Oct 15, 2018
test Added support of modulemd to combined profile; ENT-834 Oct 8, 2018
vagrant Vagrant: use ansible-role-subman-devel via galaxy Aug 17, 2018
.branches Add config for "checkcommits" May 18, 2012
.coveragerc Move python-rhsm build into subscription-manager Oct 30, 2017
.gitignore Vagrant: use ansible-role-subman-devel via galaxy Aug 17, 2018
.mailmap .mailmap to clean up the logs a little bit Sep 2, 2011
LICENSE Spec updates from Fedora review. Jan 3, 2012
MANIFEST.in Begin process of moving to distutils for building. May 10, 2016
Makefile 1623262: Make automatic enablement of yum plugins working again; ENT-820 Sep 5, 2018
README.Fedora 1092754: 1094879: Remove install-num-migrate-to-rhsm tool May 27, 2014
README.md Sync system purpose for sub-man subcommands Aug 22, 2018
TESTING.md ansible role rhsm-services and TESTING.md document Mar 26, 2018
Vagrantfile Use pre-provisioned centos7 box Aug 21, 2018
ansible.cfg ansible vagrant QOL fixes Jul 24, 2018
de.po 1618825: Rename de_DE.po and es_ES.po Sep 24, 2018
dev-requirements.txt Move python-rhsm build into subscription-manager Oct 30, 2017
es.po 1618825: Rename de_DE.po and es_ES.po Sep 24, 2018
pylintrc Revert "1200507: Hyphenated uses of the non-word "plugin."" May 29, 2015
requirements.txt Remove other references to python-kitchen. Jul 24, 2018
rpmlint.config 1581445: ENT-564: rhsm configuration manage_repos is not working on R… Aug 13, 2018
setup.cfg Don't run gui tests by default Jan 19, 2018
setup.py Automatic commit of package [subscription-manager] release [1.24.1-1]. Oct 15, 2018
subscription-manager-rpmlintrc Add preliminary zypper support May 8, 2017
subscription-manager.spec 1637183: Replace redhat-uep.pem properly Oct 15, 2018
test-requirements-2.6.txt Modifications for 2.6 compatibility. Jul 29, 2016
test-requirements.txt Move syspurpose out of packages directory. Jul 25, 2018
tox.ini Move python-rhsm build into subscription-manager Oct 30, 2017

README.md

subscription-manager

The Subscription Manager package provides programs and libraries to allow users to manage subscriptions and yum repositories from the Candlepin.

Local Installation

Consider using Vagrant instead (see below) for development as it can be a much more consistent and easy experience.

In order to build, develop, and test locally, please follow instructions at candlepinproject.org.

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:./syspurpose/src python -m subscription_manager.scripts.subscription_manager

Similar for other bin scripts:

PYTHONPATH=./src python -m subscription_manager.scripts.rct
PYTHONPATH=./src python -m subscription_manager.scripts.rhn_migrate_classic_to_rhsm
# ... etc.

(You can also just export PYTHONPATH instead of setting it in each command).

Vagrant

The setup that most developers are using is vagrant-libvirt with vagrant-hostmanager installed on Fedora via:

dnf install vagrant-libvirt vagrant-hostmanager

We are avoiding coupling to libvirt, but use of VirtualBox is less tested. If you'd like to ensure vagrant uses libvirt, you can set VAGRANT_DEFAULT_PROVIDER=libvirt in your environment.

vagrant up can be used to spin up various VMs set up for development work. These VMs are all configured using the included ansible role "subman-devel". The python paths and PATH inside these environments are modified so that running subscription-manager or subscription-manager-gui will use scripts and modules from the source code.

Cockpit can be accessed at port 9090 on the VM, for example: https://centos7.subman.example.com:9090/

NOTE: Use of hostnames per above requires the vagrant hostmanager plugin. Cockpit credentials are the same as user credientials; i.e. User name: vagrant password: vagrant

There are two links added in the cockpit interface: one for the subscription-manager cockpit plugin itself, and then one which runs integration tests for the D-Bus interface.

Currently, the source is set up as a vagrant shared folder using rsync. This means that it is necessary to use vagrant rsync to sync changes with the host if desired. vagrant rsync-auto can be used to monitor the directory for changes and then sync when appropriate.

The ansible role that provisions the VMs tries to find the IP address of candlepin.example.com, so if the candlepin vagrant image is started first, then the box can resolve it. (If it is started later, vagrant provision can be used to update the VM's hosts file).

Additionally, the Vagrantfile is set up for sharing base VMs with katello/forklift. Specifically, forklift plugins can be added to a subscription-manager checkout beneath vagrant/pluginsin order to provide additional base images.

If RHEL-based images are added, then the Vagrantfile uses the values of SUBMAN_RHSM_USERNAME, SUBMAN_RHSM_PASSWORD, SUBMAN_RHSM_HOSTNAME, SUBMAN_RHSM_PORT, and SUBMAN_RHSM_INSECURE to register and auto-attach during provisioning (best done in .bashrc or similar). If unspecified, hostname and port are left alone (i.e. whatever is in the VM's rhsm.conf will be untouched).

To register against subscription.rhsm.redhat.com, .bashrc might contain:

export SUBMAN_RHSM_USERNAME=foobar
export SUBMAN_RHSM_PASSWORD=password

(Replace username and password with actual values).

To register against a local candlepin instance, .bashrc might contain:

export SUBMAN_RHSM_HOSTNAME=candlepin.example.com
export SUBMAN_RHSM_PORT=443
export SUBMAN_RHSM_INSECURE=1
export SUBMAN_RHSM_USERNAME=foobar
export SUBMAN_RHSM_PASSWORD=password

(Replace username and password with actual values).

Note, however, since the registration is necessary to download RPMs to set up the VM for development, registering against a local candlepin might not be particularly useful (at least not for initial provisioning).

If you want use proxy server to play with subscription you can run it using vagrant: vagrant up proxy-server

The current info about proxy

url | proxy-server.subman.example.com:3128 username | proxyuser password | password

D-Bus Development

In a vagrant VM, the com.redhat.RHSM1 service along with related files (scripts, policy files, etc.) are linked to those from the source. However, it is necessary to restart the D-Bus service if edits are made while it is running with, for example, sudo systemctl restart rhsm.

Cockpit

The easiest way to get started with cockpit plugin development is Vagrant. Inside the VM, from the directory /vagrant/cockpit, the following commands can be used:

  • yarn install - fetch dependencies, and update the lockfile if necessary.
  • npm run build - do a build of the JavaScript source.
  • npm run watch - monitor the source for changes and rebuild the cockpit plugin when necessary.

See cockpit/README.md for more detailed information on cockpit development.

syspurpose

The syspurpose utility manages certain user-definable values tracked in the /etc/rhsm/syspurpose/syspurpose.json file (in json format).

See ./packages/syspurpose/README.md for details on getting started

Testing

We run tests using nose (see candlepinproject.org for details). Some tests are not run by default. For example, since we are not maintaining the GTK GUI for all platforms, they are not run by default. They can be included via -a gui option for the nose command. It is recommended if you run the GUI tests to also use --with-xvfb in order to use Xvfb instead of spawning GTK windows in your desktop session (ex. nosetests -a gui --with-xvfb).

More details about testing

Troubleshooting

If you are working inside one of the vagrant boxes and you find subscription-manager and/or subscription-manager-gui will not work with output that looks like the following: "Unable to find Subscription Manager module. Error: libssl.so.10: cannot open shared object file: No such file or directory"

You should be able to run vagrant provision [vm-name] from the host machine to fix the issue.

This issue can happen if the python-rhsm/build or python-rhsm/build_ext directories are copied to the virtual machine and the virtual machine provides different libraries than those available on the build host.