From c7ae273f133ac0a227bda8e20f339eb6145b0b0a Mon Sep 17 00:00:00 2001 From: Jiri Tyr Date: Fri, 18 Nov 2016 14:38:04 +0000 Subject: [PATCH] Making yum_repository module compatible with Python 3 (#3487) --- lib/ansible/modules/extras/packaging/os/yum_repository.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/extras/packaging/os/yum_repository.py b/lib/ansible/modules/extras/packaging/os/yum_repository.py index 4c6a94471cc..7848da1fb1b 100644 --- a/lib/ansible/modules/extras/packaging/os/yum_repository.py +++ b/lib/ansible/modules/extras/packaging/os/yum_repository.py @@ -19,10 +19,10 @@ # along with Ansible. If not, see . -import ConfigParser import os from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.pycompat24 import get_exception +from ansible.module_utils.six.moves import configparser DOCUMENTATION = ''' @@ -469,7 +469,7 @@ class YumRepo(object): module = None params = None section = None - repofile = ConfigParser.RawConfigParser() + repofile = configparser.RawConfigParser() # List of parameters which will be allowed in the repo file output allowed_params = [ @@ -576,7 +576,7 @@ class YumRepo(object): if len(self.repofile.sections()): # Write data into the file try: - fd = open(self.params['dest'], 'wb') + fd = open(self.params['dest'], 'w') except IOError: e = get_exception() self.module.fail_json(