redhat_subscription: Fix usage of ConfigParser (#54815)

This commit is contained in:
Christopher Snyder 2019-04-09 03:36:51 -04:00 committed by Martin Krizek
parent 0a0a2e47e0
commit 09f68fc659
2 changed files with 4 additions and 2 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- redhat_subscription - For compatibility using the redhat_subscription module on hosts set to use a python 3 interpreter, use string values when updating yum plugin configuration files.

View file

@ -260,9 +260,9 @@ class RegistrationBase(object):
cfg.read([tmpfile]) cfg.read([tmpfile])
if enabled: if enabled:
cfg.set('main', 'enabled', 1) cfg.set('main', 'enabled', '1')
else: else:
cfg.set('main', 'enabled', 0) cfg.set('main', 'enabled', '0')
fd = open(tmpfile, 'w+') fd = open(tmpfile, 'w+')
cfg.write(fd) cfg.write(fd)