Bug 1304074 - [RFE] Provide a D-Bus API for Registering a system
[RFE] Provide a D-Bus API for Registering a system
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Alex Wood
Sean Toner
: FutureFeature, Triaged
Depends On:
Blocks: 1313485 1395274
  Show dependency treegraph
Reported: 2016-02-02 14:45 EST by Barnaby Court
Modified: 2017-08-01 15:18 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-08-01 15:18:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Barnaby Court 2016-02-02 14:45:20 EST

Comment 3 Sean Toner 2017-04-17 14:57:46 EDT
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 14:58 EDT
Created attachment 1272141 [details]
using busctl to call Register method
Comment 5 Sean Toner 2017-04-17 14:59 EDT
Created attachment 1272142 [details]
using busctl to call RegisterWithActivationKeys method
Comment 6 Sean Toner 2017-04-17 15:03:49 EDT
Tested against:

[root@stoner-rhel-74 subman1.9.7]# rpm -qa | grep  subscription
Comment 7 errata-xmlrpc 2017-08-01 15:18:42 EDT
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.