Bug 1304074 - [RFE] Provide a D-Bus API for Registering a system
Summary: [RFE] Provide a D-Bus API for Registering a system
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.3
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Alex Wood
QA Contact: Sean Toner
Depends On:
Blocks: 1313485 1395274
TreeView+ depends on / blocked
Reported: 2016-02-02 19:45 UTC by Barnaby Court
Modified: 2017-08-01 19:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Last Closed: 2017-08-01 19:18:42 UTC
Target Upstream Version:

Attachments (Terms of Use)
using busctl to call Register method (25.39 KB, text/plain)
2017-04-17 18:58 UTC, Sean Toner
no flags Details
using busctl to call RegisterWithActivationKeys method (25.25 KB, text/plain)
2017-04-17 18:59 UTC, Sean Toner
no flags Details

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2083 normal SHIPPED_LIVE python-rhsm and subscription-manager bug fix and enhancement update 2017-08-01 18:14:19 UTC

Description Barnaby Court 2016-02-02 19:45:20 UTC

Comment 3 Sean Toner 2017-04-17 18:57:46 UTC
I manually tested by doing the following:

Created a stage account, and edit the /etc/rhsm/rhsm.conf to point to the stage candlepin.  I also generated an activation key from the stage customer portal.  I 

I then ran `systemctl restart rhsm.service` and then ran `subscription-manager orgs` to get the org ID.  I made sure that the dbus service was running by calling:

busctl | grep RHSM

and verified that the service was running and not activatable.  I then did the first part of registering by starting the register server:

busctl call com.redhat.RHSM1 /com/redhat/RHSM1/RegisterServer com.redhat.RHSM1.RegisterServer Start

This gave me the reply back of:

s "unix:abstract=/var/run/dbus-hFLSsUWi7q,guid=1cc8ab09c9c716d9f755819358f50415"

This response provided the unix socket ID of "unix:abstract=/var/run/dbus-hFLSsUWi7q", which is necessary for the other busctl calls.  Since the register server now had a unix socket to communicate over (a peer-to-peer), the call to actually do the registering was done as below:

busctl call --address=unix:abstract=/var/run/dbus-hFLSsUWi7q com.redhat.RHSM1 /com/redhat/RHSM1/Register com.redhat.RHSM1.Register Register 'sssa{sv}' 10930238 BZ1304074 ________ 0

The 10930238, BZ1304074 and _______ are the org, username and password respectively.  The result of running the above command can be seen in the attachment Register.txt.  Lastly, I also tested registering via an activation key.  The command to do this was:

busctl call --address=unix:abstract=/var/run/dbus-hFLSsUWi7q com.redhat.RHSM1 /com/redhat/RHSM1/Register com.redhat.RHSM1.Register RegisterWithActivationKeys 'sasa{sv}' 10930238 1 BZ1304074-Key 0

Where "10930238 1 BZ1304074-Key 0" is the encoding for dbus args using busctl where I passed in just one activation key with a name of BZ1304074-Key, and no extra args were used for registration.  The result of this command can be seen in the attachment RegisterWithKey.txt

Comment 4 Sean Toner 2017-04-17 18:58:45 UTC
Created attachment 1272141 [details]
using busctl to call Register method

Comment 5 Sean Toner 2017-04-17 18:59:59 UTC
Created attachment 1272142 [details]
using busctl to call RegisterWithActivationKeys method

Comment 6 Sean Toner 2017-04-17 19:03:49 UTC
Tested against:

[root@stoner-rhel-74 subman1.9.7]# rpm -qa | grep  subscription

Comment 7 errata-xmlrpc 2017-08-01 19:18:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.