Bug 1880920

Summary: no warning message is displayed when you try to add invalid addons
Product: Red Hat Enterprise Linux 8 Reporter: Shwetha Kallesh <skallesh>
Component: subscription-managerAssignee: Pino Toscano <ptoscano>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.3CC: jsefler, redakkan
Target Milestone: rcKeywords: Triaged
Target Release: 8.5Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.28.16-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:37:35 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:

Description Shwetha Kallesh 2020-09-21 06:58:36 UTC
Description of problem:
no warning message is displayed when you try to add invalid addons

Version-Release number of selected component (if applicable):
[root@kvm-01-guest12 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.1.20-1
subscription management rules: 5.41
subscription-manager: 1.27.16-1.el8


How reproducible:


Steps to Reproduce:
[root@kvm-01-guest12 ~]# subscription-manager addons --add Foobar1 --username=testuser1 --password=password --org=admin
addons updated.
^^ warning message is displayed

[root@kvm-01-guest12 ~]# syspurpose show
{
  "addons": [
    "Foobar1"
  ],
}


Actual results:
no warning message is displayed

Expected results:
Warning message should be displayed

Additional info:

Comment 1 John Sefler 2020-09-21 12:43:39 UTC
Just to be clear on this bugzilla, the behavior is currently...

[root@rhsm-auto8-client2 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.1.20-1
subscription management rules: 5.41
subscription-manager: 1.27.16-1.el8

[root@rhsm-auto8-client2 ~]# subscription-manager addons --list --username=testuser1 --password=password --org=admin
+-------------------------------------------+
              Available addons
+-------------------------------------------+
 - ADDON1
 - ADDON3
 - ADDON2
[root@rhsm-auto8-client2 ~]# subscription-manager addons --add Foobar --username=testuser1 --password=password --org=admin
addons updated.
[root@rhsm-auto8-client2 ~]# 


The expected results for adding an unavailable addon is...
Warning: Provided value "Foobar" is not included in the list of valid values
 - ADDON1
 - ADDON3
 - ADDON2
addons updated.

Comment 4 Shwetha Kallesh 2021-04-27 09:58:34 UTC
Reproducer :

[root@kvm-04-guest15 ~]# subscription-manager addons --add Foobar1 --username=testuser1 --password=password --org=admin
addons updated.
[root@kvm-04-guest15 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.16-1
subscription management rules: 5.41
subscription-manager: 1.28.13-2.el8

Comment 5 Shwetha Kallesh 2021-04-27 10:01:17 UTC
pre-verification comments:

[root@kvm-04-guest15 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.11-1
subscription management rules: 5.41
subscription-manager: 1.28.16-1.el8


[root@kvm-04-guest15 ~]# subscription-manager register
Registering to: shwetha-workstation.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Hint: User "admin" is member of following organizations: donaldduck, snowwhite, admin
Organization: admin
The system has been registered with ID: f9da42e9-518a-4d3b-8d7f-6de858586e8f
The registered system name is: kvm-04-guest15.lab.eng.rdu2.redhat.com
[root@kvm-04-guest15 ~]# subscription-manager addons --add Foobar1
Warning: Provided value "Foobar1" is not included in the list of valid values
 - ADDON1
 - ADDON3
 - ADDON2
addons updated.
^^ observe the warning message along with valid values that are available for that account

[root@kvm-04-guest15 ~]# subscription-manager unregister
Unregistering from: shwetha-workstation.usersys.redhat.com:8443/candlepin
System has been unregistered.


[root@kvm-04-guest15 ~]# subscription-manager addons --add Foobar1 --username=testuser1 --password=password --org=admin
Warning: Provided value "Foobar1" is not included in the list of valid values
 - ADDON1
 - ADDON3
 - ADDON2
addons updated.
^^ observe the warning message along with valid values that are available for that account

Comment 8 Rehana 2021-05-18 15:34:09 UTC
Verifying on : 
=============

# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 4.1.0-1
subscription management rules: 5.41
subscription-manager: 1.28.16-1.el8

Verifying on server that has addons entries available :
=======================================================
# subscription-manager addons --add Foobar1
Warning: Provided value "Foobar1" is not included in the list of valid values
 - ADDON3
 - ADDON2
 - ADDON1
addons updated.

# 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": [
    "Foobar1"
  ]
}

Verifying Against a sever that does not have any addons available 
==========================================================
# subscription-manager addons --add Foobar1
Warning: the list of valid values for attribute "addons" is empty.
addons updated.


Based on the above observations, moving the bug to Verified!!

Comment 10 errata-xmlrpc 2021-11-09 19:37:35 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-2021:4390