using ConfigParser.read_file for PY3

This commit is contained in:
Yu Ming Zhu 2018-11-06 00:15:03 +00:00 committed by Mike McLean
parent 8cc1c93dc2
commit 9ddae41877
6 changed files with 76 additions and 23 deletions

View file

@ -5823,10 +5823,7 @@ def handle_image_build(options, session, args):
if not os.path.exists(task_options.config):
parser.error(_("%s not found!" % task_options.config))
section = 'image-build'
config = six.moves.configparser.ConfigParser()
conf_fd = open(task_options.config)
config.readfp(conf_fd)
conf_fd.close()
config = koji.read_config_files(task_options.config)
if not config.has_section(section):
parser.error(_("single section called [%s] is required" % section))
# pluck out the positional arguments first