python-modernize -f libmodernize.fixes.fix_imports_six
This commit is contained in:
parent
f03646bab5
commit
be535c2854
21 changed files with 81 additions and 81 deletions
|
|
@ -3,7 +3,7 @@
|
|||
from __future__ import absolute_import
|
||||
import commands
|
||||
import koji
|
||||
import ConfigParser
|
||||
import six.moves.configparser
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
|
|
@ -49,7 +49,7 @@ class RunRootTask(koji.tasks.BaseTaskHandler):
|
|||
return res
|
||||
|
||||
def _read_config(self):
|
||||
cp = ConfigParser.SafeConfigParser()
|
||||
cp = six.moves.configparser.SafeConfigParser()
|
||||
cp.read(CONFIG_FILE)
|
||||
self.config = {
|
||||
'default_mounts': [],
|
||||
|
|
@ -90,7 +90,7 @@ class RunRootTask(koji.tasks.BaseTaskHandler):
|
|||
'fstype': cp.get(section_name, 'fstype'),
|
||||
'options': cp.get(section_name, 'options'),
|
||||
})
|
||||
except ConfigParser.NoOptionError:
|
||||
except six.moves.configparser.NoOptionError:
|
||||
raise koji.GenericError("bad config: missing options in %s section" % section_name)
|
||||
|
||||
for path in self.config['default_mounts'] + self.config['safe_roots'] + [x[0] for x in self.config['path_subs']]:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import fnmatch
|
|||
import os
|
||||
import sys
|
||||
import tarfile
|
||||
import ConfigParser
|
||||
import six.moves.configparser
|
||||
|
||||
import koji
|
||||
import koji.tasks as tasks
|
||||
|
|
@ -28,7 +28,7 @@ def omit_paths3(tarinfo):
|
|||
|
||||
def read_config():
|
||||
global config
|
||||
cp = ConfigParser.SafeConfigParser()
|
||||
cp = six.moves.configparser.SafeConfigParser()
|
||||
cp.read(CONFIG_FILE)
|
||||
config = {
|
||||
'path_filters': [],
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from __future__ import absolute_import
|
|||
from koji import PluginError
|
||||
from koji.context import context
|
||||
from koji.plugin import callbacks, callback, ignore_error, convert_datetime
|
||||
import ConfigParser
|
||||
import six.moves.configparser
|
||||
import logging
|
||||
import qpid.messaging
|
||||
import qpid.messaging.transports
|
||||
|
|
@ -79,7 +79,7 @@ def get_config():
|
|||
if config:
|
||||
return config
|
||||
|
||||
config = ConfigParser.SafeConfigParser()
|
||||
config = six.moves.configparser.SafeConfigParser()
|
||||
config.read(CONFIG_FILE)
|
||||
if not config.has_option('broker', 'timeout'):
|
||||
config.set('broker', 'timeout', '60')
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from __future__ import absolute_import
|
|||
import koji
|
||||
from koji.plugin import callback, ignore_error, convert_datetime
|
||||
from koji.context import context
|
||||
import ConfigParser
|
||||
import six.moves.configparser
|
||||
import logging
|
||||
import json
|
||||
import random
|
||||
|
|
@ -270,7 +270,7 @@ def send_queued_msgs(cbtype, *args, **kws):
|
|||
log = logging.getLogger('koji.plugin.protonmsg')
|
||||
global CONFIG
|
||||
if not CONFIG:
|
||||
conf = ConfigParser.SafeConfigParser()
|
||||
conf = six.moves.configparser.SafeConfigParser()
|
||||
with open(CONFIG_FILE) as conffile:
|
||||
conf.readfp(conffile)
|
||||
CONFIG = conf
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import koji
|
|||
from koji.context import context
|
||||
from koji.plugin import callback
|
||||
from koji.util import rmtree
|
||||
import ConfigParser
|
||||
import six.moves.configparser
|
||||
import fnmatch
|
||||
import os
|
||||
import shutil
|
||||
|
|
@ -32,7 +32,7 @@ def maven_import(cbtype, *args, **kws):
|
|||
filepath = kws['filepath']
|
||||
|
||||
if not config:
|
||||
config = ConfigParser.SafeConfigParser()
|
||||
config = six.moves.configparser.SafeConfigParser()
|
||||
config.read(CONFIG_FILE)
|
||||
name_patterns = config.get('patterns', 'rpm_names').split()
|
||||
for pattern in name_patterns:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import absolute_import
|
||||
import sys
|
||||
import ConfigParser
|
||||
import six.moves.configparser
|
||||
import koji
|
||||
from koji.context import context
|
||||
from koji.plugin import export
|
||||
|
|
@ -29,7 +29,7 @@ def saveFailedTree(buildrootID, full=False, **opts):
|
|||
|
||||
# read configuration only once
|
||||
if config is None:
|
||||
config = ConfigParser.SafeConfigParser()
|
||||
config = six.moves.configparser.SafeConfigParser()
|
||||
config.read(CONFIG_FILE)
|
||||
allowed_methods = config.get('permissions', 'allowed_methods').split()
|
||||
if len(allowed_methods) == 1 and allowed_methods[0] == '*':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue