summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_yum_add_repo.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config/cc_yum_add_repo.py')
-rw-r--r--cloudinit/config/cc_yum_add_repo.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/cloudinit/config/cc_yum_add_repo.py b/cloudinit/config/cc_yum_add_repo.py
index 3b354a7d..3673166a 100644
--- a/cloudinit/config/cc_yum_add_repo.py
+++ b/cloudinit/config/cc_yum_add_repo.py
@@ -30,13 +30,9 @@ entry, the config entry will be skipped.
# any repository configuration options (see man yum.conf)
"""
+import io
import os
-
-try:
- from configparser import ConfigParser
-except ImportError:
- from ConfigParser import ConfigParser
-import six
+from configparser import ConfigParser
from cloudinit import util
@@ -57,7 +53,7 @@ def _format_repo_value(val):
# Can handle 'lists' in certain cases
# See: https://linux.die.net/man/5/yum.conf
return "\n".join([_format_repo_value(v) for v in val])
- if not isinstance(val, six.string_types):
+ if not isinstance(val, str):
return str(val)
return val
@@ -72,7 +68,7 @@ def _format_repository_config(repo_id, repo_config):
# For now assume that people using this know
# the format of yum and don't verify keys/values further
to_be.set(repo_id, k, _format_repo_value(v))
- to_be_stream = six.StringIO()
+ to_be_stream = io.StringIO()
to_be.write(to_be_stream)
to_be_stream.seek(0)
lines = to_be_stream.readlines()