Bug 1489917 - disabling yum plugins using "false" (rather than "0") causes traceback: invalid literal for int() with base 10: 'false'
Summary: disabling yum plugins using "false" (rather than "0") causes traceback: inval...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.5
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: Jiri Hnidek
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-08 16:11 UTC by John Sefler
Modified: 2018-04-10 09:51 UTC (History)
5 users (show)

Fixed In Version: subscription-manager-1.20.2-1
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 09:51:13 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github /candlepin subscription-manager pull 1701 None None None 2017-09-19 07:40:44 UTC
Red Hat Product Errata RHBA-2018:0681 None None None 2018-04-10 09:51:43 UTC

Description John Sefler 2017-09-08 16:11:14 UTC
Description of problem:
When setting the enabled configuration value in /etc/yum/pluginconf.d/product-id.conf or /etc/yum/pluginconf.d/subscription-manager.conf to "false" or "true" rather than "0" or "1", subscription-manager is blocked by a traceback...
   invalid literal for int() with base 10: 'false'

Note: Yum gracefully accepts both "false"|"0" as booleans values, but subscription-manager does not.

Version-Release number of selected component (if applicable):
[root@jsefler-rhel7 ~]# rpm -q subscription-manager
subscription-manager-1.20.1-1.git.48.bc07705.el7.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-rhel7 ~]# subscription-manager unregister 
This system is currently not registered.
[root@jsefler-rhel7 ~]# sed -i 's/^enabled\s*=.*$/enabled=false/g' /etc/yum/pluginconf.d/product-id.conf
[root@jsefler-rhel7 ~]# cat /etc/yum/pluginconf.d/product-id.conf
[main]
enabled=false
[root@jsefler-rhel7 ~]# yum repolist
Loaded plugins: langpacks, search-disabled-repos, subscription-manager    <=== NOTICE product-id WAS NOT LOADED
This system is not registered with an entitlement server. You can use subscription-manager to register.
repolist: 0
[root@jsefler-rhel7 ~]# subscription-manager version
invalid literal for int() with base 10: 'false'
[root@jsefler-rhel7 ~]# 


Actual results:
  invalid literal for int() with base 10: 'false'

Expected results:
  a WARNING message will be displayed when /etc/yum/pluginconf.d/product-id.conf is disabled informing us that it was automatically enabled.


Additional info:

[root@jsefler-rhel7 ~]# tail -f /var/log/rhsm/rhsm.log
2017-09-08 11:42:28,448 [DEBUG] subscription-manager:3072:MainThread @repolib.py:150 - Yum plugin: "/etc/yum/pluginconf.d/subscription-manager.conf" already enabled. Nothing to do.
2017-09-08 11:42:28,449 [ERROR] subscription-manager:3072:MainThread @managercli.py:181 - exception caught in subscription-manager
2017-09-08 11:42:28,449 [ERROR] subscription-manager:3072:MainThread @managercli.py:182 - invalid literal for int() with base 10: 'false'
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 96, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 87, in main
    return managercli.ManagerCLI().main()
  File "/usr/lib/python2.7/site-packages/subscription_manager/managercli.py", line 2640, in main
    enabled_yum_plugins = YumPluginManager.enable_yum_plugins()
  File "/usr/lib/python2.7/site-packages/subscription_manager/repolib.py", line 148, in enable_yum_plugins
    is_plugin_enabled = yum_plugin_config.getint('main', 'enabled')
  File "/usr/lib/python2.7/site-packages/iniparse/compat.py", line 135, in getint
    return int(self.get(section, option))
ValueError: invalid literal for int() with base 10: 'false'

Comment 2 Shwetha Kallesh 2017-11-10 06:25:54 UTC
[root@dhcp35-121 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.20.5-1.el7

[root@dhcp35-121 ~]#  sed -i 's/^enabled\s*=.*$/enabled=false/g' /etc/yum/pluginconf.d/product-id.conf
[root@dhcp35-121 ~]# cat /etc/yum/pluginconf.d/product-id.conf
[main]
enabled=false

[root@dhcp35-121 ~]#  yum repolist
Loaded plugins: langpacks, search-disabled-repos, subscription-manager
This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions.
repolist: 0

Observe the warning :

[root@dhcp35-121 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.20.5-1.el7


WARNING

The yum plugins: /etc/yum/pluginconf.d/product-id.conf were automatically enabled for the benefit of Red Hat Subscription Management. If not desired, use "subscription-manager config --rhsm.auto_enable_yum_plugins=0" to block this behavior.

Comment 5 errata-xmlrpc 2018-04-10 09:51:13 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, 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-2018:0681


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