Bug 1659043 - addon is actually not removed from syspurpose.json file though message says its removed
Summary: addon is actually not removed from syspurpose.json file though message says i...
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-13 12:50 UTC by Shwetha Kallesh
Modified: 2019-01-16 10:30 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

Description Shwetha Kallesh 2018-12-13 12:50:07 UTC
Description of problem:
Addon is actually not removed from syspurpose.json file though message says its removed.
This problem is reproducible only on a registered system and only if you follow the exact steps in the reproducer below


Version-Release number of selected component (if applicable):
[root@kvm-03-guest11 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.6.0-1
subscription management rules: 5.30
subscription-manager: 1.23.8-6.el8


How reproducible:


Steps to Reproduce:
[root@kvm-03-guest11 ~]# syspurpose show
{
  "service_level_agreement": "",
  "addons": [
    "EUS",
    "ELS"
  ]
}

Do a syspurpose unset of addons:
----------------------------------------------------------------------------

[root@kvm-03-guest11 ~]# syspurpose unset-addons
addons unset
System purpose successfully sent to subscription management server.

Verify if the addons are removed from the file:
--------------------------------------------------------------
[root@kvm-03-guest11 ~]# cat /etc/rhsm/syspurpose/syspurpose.json
{
  "addons": [],
  "service_level_agreement": ""
}

Add the addons back again
--------------------------------------------------------------

[root@kvm-03-guest11 ~]#syspurpose add-addons ELS EUS
Added ELS to addons.
Added EUS to addons.
System purpose successfully sent to subscription management server.

Verify if the addons are present in the file:
--------------------------------------------------------
[root@kvm-03-guest11 ~]# cat /etc/rhsm/syspurpose/syspurpose.json
{
  "addons": [
    "ELS",
    "EUS"
  ],
  "service_level_agreement": ""
}

Try removing the addons
-------------------------------------------------------------------------
[root@kvm-03-guest11 ~]#syspurpose remove-addons EUS ELS
Removed EUS from addons.
Removed ELS from addons.
System purpose successfully sent to subscription management server.

Verify if addons are removed from the file:
[root@kvm-03-guest11 ~]# cat /etc/rhsm/syspurpose/syspurpose.json
{
  "addons": [
    "EUS",
    "ELS"
  ],
  "service_level_agreement": ""
}

^^ observe that addons are actually not removed

Actual results:
Addons are not removed

Expected results:
Addons should be removed

Additional info:

Comment 1 Kevin Howell 2019-01-07 15:57:21 UTC
Can you please retest against the latest build?

Comment 2 Shwetha Kallesh 2019-01-09 09:08:01 UTC
Issue is no longer reproducible with following version of sub-man

[root@kvm-04-guest14 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.6.0-1
subscription management rules: 5.30
subscription-manager: 1.23.8-12.el8


[root@kvm-04-guest14 ~]# syspurpose show
{
  "addons": [
    "EUS",
    "ELS"
  ]
}
System purpose successfully sent to subscription management server.
[root@kvm-04-guest14 ~]# syspurpose unset-addons
addons unset
System purpose successfully sent to subscription management server.
[root@kvm-04-guest14 ~]# cat /etc/rhsm/syspurpose/syspurpose.json
{}[root@kvm-04-guest14 ~]# syspurpose add-addons ELS EUS
Added ELS to addons.
Added EUS to addons.
System purpose successfully sent to subscription management server.
[root@kvm-04-guest14 ~]#  cat /etc/rhsm/syspurpose/syspurpose.json
{
  "addons": [
    "ELS",
    "EUS"
  ]
}[root@kvm-04-guest14 ~]# syspurpose remove-addons EUS ELS
Removed EUS from addons.
Removed ELS from addons.
System purpose successfully sent to subscription management server.
[root@kvm-04-guest14 ~]# cat /etc/rhsm/syspurpose/syspurpose.json
{}

Comment 3 Shwetha Kallesh 2019-01-16 10:30:19 UTC
[root@kvm-02-guest11 ~]# syspurpose show
{
  "addons": [
    "EUS",
    "ELS"
  ]
}
System purpose successfully sent to subscription management server.
[root@kvm-02-guest11 ~]# syspurpose unset-addons
addons unset
System purpose successfully sent to subscription management server.
[root@kvm-02-guest11 ~]# cat /etc/rhsm/syspurpose/syspurpose.json
{}[root@kvm-02-guest11 ~]# syspurpose add-addons ELS EUS
Added ELS to addons.
Added EUS to addons.
System purpose successfully sent to subscription management server.
[root@kvm-02-guest11 ~]# cat /etc/rhsm/syspurpose/syspurpose.json
{
  "addons": [
    "ELS",
    "EUS"
  ]
}[root@kvm-02-guest11 ~]# syspurpose remove-addons EUS ELS
Removed EUS from addons.
Removed ELS from addons.
System purpose successfully sent to subscription management server.
[root@kvm-02-guest11 ~]#  cat /etc/rhsm/syspurpose/syspurpose.json
{}[root@kvm-02-guest11 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.6.0-1
subscription management rules: 5.30
subscription-manager: 1.23.8-14.el8


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