Bug 1470528 - Do not blindly ignore subscription-manager errors
Do not blindly ignore subscription-manager errors
Status: VERIFIED
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: gdeploy (Show other bugs)
3.2
Unspecified Unspecified
unspecified Severity medium
: ---
: RHGS 3.3.1 Async
Assigned To: Sachidananda Urs
Manisha Saini
: ZStream
Depends On:
Blocks: 1581561
  Show dependency treegraph
 
Reported: 2017-07-13 02:20 EDT by Sachidananda Urs
Modified: 2018-05-23 01:50 EDT (History)
7 users (show)

See Also:
Fixed In Version: gdeploy-2.0.2-26
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sachidananda Urs 2017-07-13 02:20:36 EDT
Description of problem:

subscription-manager errors can be of two types:
i. Actual errors (incorrect username/password/network timeout etc)
ii. Error due to `User already subscribed`

Handle the above errors gracefully instead of ignoring the errors blindly.

Refer: BZ #1405966
Comment 3 Sachidananda Urs 2017-09-14 03:36:59 EDT
(In reply to Sachidananda Urs from comment #0)
> Description of problem:
> 
> subscription-manager errors can be of two types:
> i. Actual errors (incorrect username/password/network timeout etc)
> ii. Error due to `User already subscribed`
> 
> Handle the above errors gracefully instead of ignoring the errors blindly.
> 
> Refer: BZ #1405966

The latest version of Ansible invalidates this bug.
subscription-module in Ansible handles the `already subscribed' cases.

I'll keep this bug open for QE to verify.

Steps to reproduce:
===================

Subscribe to CDN with the below config file:

**********************

[hosts]
host-1
host-2
host-3
host-4

#Subscribe to necessary channels
[RH-subscription1]
action=register
username=user@redhat.com
password=<password>
ignore_register_errors=no

**********************

Once subscribed, re-run the configuration file. One should not see
any errors.
Comment 8 Sachidananda Urs 2018-04-16 11:20:46 EDT
Commit: https://github.com/gluster/gdeploy/pull/499/commits/44afd9ff521d40

Should fix the issue.

===================================

[sac@dhcp35-44 tmp]$ gdeploy -c subscription_error.conf       

PLAY [gluster_servers] *****************************************************************************************************

TASK [Register with activation key, if activation key is provided] *********************************************************
skipping: [10.70.42.25]        

TASK [Register with subscription-manager with username and password] *******************************************************
changed: [10.70.42.25]                                                                                                      
                                                                                                                            
TASK [Attach to Red Hat subscription pool] *********************************************************************************
changed: [10.70.42.25]         

TASK [Disable all rhsm repos] **********************************************************************************************
skipping: [10.70.42.25]        

TASK [Enable necessary rhsm repos] *****************************************************************************************

TASK [Remove old apt-mirror repository definition.] ************************************************************************
ok: [10.70.42.25]                                                                                                           

PLAY RECAP *****************************************************************************************************************
10.70.42.25                : ok=3    changed=2    unreachable=0    failed=0          

-----------------------

Running the configuration again shows:
======================================

[sac@dhcp35-44 tmp]$ gdeploy -c subscription_error.conf 

PLAY [gluster_servers] *****************************************************************************************************

TASK [Register with activation key, if activation key is provided] *********************************************************
skipping: [10.70.42.25]

TASK [Register to subscription-manager with username and password] *********************************************************
ok: [10.70.42.25]                                                                                                                               
TASK [Attach to Red Hat subscription pool] *********************************************************************************
ok: [10.70.42.25]

TASK [Disable all rhsm repos] **********************************************************************************************
skipping: [10.70.42.25]

TASK [Enable necessary rhsm repos] *****************************************************************************************

TASK [Remove old apt-mirror repository definition.] ************************************************************************
ok: [10.70.42.25]

PLAY RECAP *****************************************************************************************************************
10.70.42.25                : ok=3    changed=0    unreachable=0    failed=0   

[sac@dhcp35-44 tmp]$ 

==================================================================

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