Bug 2000867

Summary: [RHEL8.6] Display information about "syspurpose" tool deprecation when the tool is used
Product: Red Hat Enterprise Linux 8 Reporter: Rehana <redakkan>
Component: subscription-managerAssignee: Pino Toscano <ptoscano>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: high    
Version: 8.6CC: jsefler, ptoscano, zpetrace
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.28.24-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 15:22:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2000883    
Bug Blocks:    

Description Rehana 2021-09-03 08:39:10 UTC
Description of problem:

We will be retiring syspurpose tool in RHEL 9 (Bug 1876565 ). This request is to update the existing syspurpose tool with deprecation warnings. 

Version-Release number of selected component (if applicable):


How reproducible:
Always 

Steps to Reproduce:
1.Use syspurpose tool in RHEL 8.6 
2.
3.

Actual results:
Value gets set to system purpose attribute 

Expected results:
Value should still be set bug a additional information about deprecation should be provided and user should be directed to use the subscription-manager tooling to set the syspurpose values

Comment 1 John Sefler 2021-10-12 16:48:43 UTC
*** Bug 1878133 has been marked as a duplicate of this bug. ***

Comment 2 Zdenek Petracek 2021-11-03 15:22:42 UTC
Pre-verifying build python3-syspurpose-1.28.22-1.git.0.5118d85.el8.x86_64

[root@kvm-07-guest13 ~]# rpm -q python3-syspurpose --changelog | grep 2000867
- 2000867: syspurpose: show deprecation notices (ptoscano)

The 'syspurpose' command is deprecated and will be removed in a future major
release. Please use the 'subscription-manager syspurpose' command going
forward.

Pre-verification 1
The above message popped-up after command "syspurpose --help"

Pre-verification 2
[root@kvm-07-guest13 ~]# syspurpose set-role server
The 'syspurpose' command is deprecated and will be removed in a future major release. Please use the 'subscription-manager syspurpose' command going forward.
role set to "server".

Pre-verification 3
[root@kvm-07-guest13 ~]# syspurpose show
The 'syspurpose' command is deprecated and will be removed in a future major release. Please use the 'subscription-manager syspurpose' command going forward.
{
  "role": "server"
}

Pre-verification 4
// In pre-verification number 4 I tried the new command and it defaults to syspurpose show function 
[root@kvm-07-guest13 ~]# subscription-manager syspurpose
{
  "role": "server",
  "usage": "server"
}

Pre-verification 5
// The man page for syspurpose presents the following message:
DEPRECATION NOTICE
       This  command is deprecated and will be removed in a future major release.  Please use the subscription-manager syspurpose command going for‐
       ward.

Comment 7 Zdenek Petracek 2021-11-25 13:22:00 UTC
Version:
[root@kvm-01-guest08 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.2.21-1
subscription management rules: 5.41
subscription-manager: 1.28.24-1.el8

[root@kvm-01-guest08 ~]# rpm -q python3-syspurpose --changelog | grep 2000867
- 2000867: syspurpose: show deprecation notices (ptoscano)

Verification 1:
[root@kvm-01-guest08 ~]# syspurpose --help
usage: syspurpose [-h]
                  {set,unset,add,remove,set-role,unset-role,add-addons,remove-addons,unset-addons,set-sla,unset-sla,set-usage,unset-usage,show}
                  ...

System Syspurpose Management Tool

positional arguments:
  {set,unset,add,remove,set-role,unset-role,add-addons,remove-addons,unset-addons,set-sla,unset-sla,set-usage,unset-usage,show}
                        sub-command help
    set                 Sets the value for the given property
    unset               Unsets (clears) the value for the given property
    add                 Adds the value(s) to the given property
    remove              Removes the value(s) from the given property
    set-role            Set the system role to the system syspurpose
    unset-role          Clear set role
    add-addons          Add addons to the system syspurpose
    remove-addons       Remove addons from the system syspurpose
    unset-addons        Clear set addons
    set-sla             Set the system sla
    unset-sla           Clear set sla
    set-usage           Set the system usage
    unset-usage         Clear set usage
    show                Show the current system syspurpose

optional arguments:
  -h, --help            show this help message and exit

The 'syspurpose' command is deprecated and will be removed in a future major
release. Please use the 'subscription-manager syspurpose' command going
forward.
--> PASSED

Verification 2:
[root@kvm-01-guest08 ~]# syspurpose set-role "Red Hat Enterprise Linux Server"
The 'syspurpose' command is deprecated and will be removed in a future major release. Please use the 'subscription-manager syspurpose' command going forward.
role set to "Red Hat Enterprise Linux Server".
--> PASSED

Verification 3:
[root@kvm-01-guest08 ~]# syspurpose show
The 'syspurpose' command is deprecated and will be removed in a future major release. Please use the 'subscription-manager syspurpose' command going forward.
{
  "addons": [
    "HA"
  ],
  "role": "Red Hat Enterprise Linux Server",
  "service_level_agreement": "Premium",
  "usage": "QA"
}
--> PASSED

Verification 4 - man page:
[root@kvm-01-guest08 ~]# man syspurpose

NAME
       syspurpose - Set the intended purpose for this system

SYNOPSIS
       syspurpose [COMMAND] [OPTION]...

DEPRECATION NOTICE
       This command is deprecated and will be removed in a future major release.  Please use the subscription-manager syspurpose command going forward.
--> PASSED

Comment 9 errata-xmlrpc 2022-05-10 15:22:57 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 (subscription-manager bug fix and enhancement update), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHBA-2022:2047