Easily know if a Client is registered or not

Bug #1912516 reported by João Pedro Seara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
Undecided
Kevin Nasto
landscape-client (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Feature request:

There are no commands to know if a Client is registered, and License info. This is helpful for auditing reasons, for example.

landscape-registration-info, or something like it.

Changed in landscape-client:
assignee: nobody → Kevin Nasto (silverdrake11)
Revision history for this message
Kevin Nasto (silverdrake11) wrote :
Simon Poirier (simpoir)
Changed in landscape-client:
status: New → In Progress
Simon Poirier (simpoir)
Changed in landscape-client:
status: In Progress → Fix Committed
Revision history for this message
Mustafa Kemal Gilor (mustafakemalgilor) wrote (last edit ):

(for any future travelers) I've come up with the following one-liner to detect whether the "landscape-client" is registered or not:

```bash
(python3 -c "from landscape.lib import bpickle; from landscape.client.broker.service import BrokerService; print('registered' if bool(bpickle.loads(open('/var/lib/landscape/client/{}.bpickle'.format(BrokerService.service_name), 'rb').read())['registration']['secure-id']) else 'not registered')" 2&>/dev/null && echo "registered") || echo "not registered"
```

It is basically a distilled version of the upstream patch, tested on bionic, focal, jammy, and kinetic. Could be used as a workaround until the feature lands.

Revision history for this message
Kevin Nasto (silverdrake11) wrote :

The feature is landed already on the beta. I would recommend using the beta ppa. It is released for bionic, jammy, focal, and kinetic. sudo add-apt-repository ppa:landscape/self-hosted-beta

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 23.02-0ubuntu1

---------------
landscape-client (23.02-0ubuntu1) lunar; urgency=medium

  * New upstream release 23.02:
    - Preventing the generation of large messages and logs that can overwhelm
      Landscape Server (LP: #1995775)
    - Improved MOTD slowdown on machines with many tap network interfaces
      (LP: #2006396)
    - No longer using deprecated apt-key when storing trusted GPG keys
      (LP: #1973202)
    - Fixed issue recognising Parallels VMs as Virtual Machine clients
      (LP: #1827909)
    - Fixes for incorrect logfile rotation config (LP: #1968189)
    - Client-side backoff handling to moderate traffic to Landscape Server
      during high load (LP: #1947399)
    - Avoid sending empty messages when catching up to expected next message
      (LP: #1917540)
    - --is-registered CLI option to quickly check if client is registered
      (LP: #1912516)
    - Can now report Ubuntu Pro attachment information if the version of
      Landscape Server it is registered to supports this (LP: #2006401)
    - Packages installed as dependencies as part of package profiles are now
      appropriately autoremovable (LP: #1878957)
    - Registration timeouts give an error instead of timing out (LP: #1889464)
    - RHEV hypervisor VMs are now recognized as virtual machines (LP: #1884116)
    - Doing a Landscape-driven release upgrade from a release running python 2
      to one running python 3 no longer hangs forever (LP: #1943291)

 -- Mitch Burton <email address hidden> Wed, 08 Feb 2023 10:23:31 -0800

Changed in landscape-client (Ubuntu):
status: New → Fix Released
Changed in landscape-client:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.