summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Options
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Bcfg2/Options')
-rw-r--r--src/lib/Bcfg2/Options/Actions.py2
-rw-r--r--src/lib/Bcfg2/Options/Options.py8
-rw-r--r--src/lib/Bcfg2/Options/Parser.py2
-rw-r--r--src/lib/Bcfg2/Options/Subcommands.py6
-rw-r--r--src/lib/Bcfg2/Options/Types.py2
5 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/Bcfg2/Options/Actions.py b/src/lib/Bcfg2/Options/Actions.py
index 854e6039d..051f4adcb 100644
--- a/src/lib/Bcfg2/Options/Actions.py
+++ b/src/lib/Bcfg2/Options/Actions.py
@@ -104,7 +104,7 @@ class ComponentAction(FinalizableAction):
def __init__(self, *args, **kwargs):
if self.mapping and not self.islist:
if 'choices' not in kwargs:
- kwargs['choices'] = self.mapping.keys()
+ kwargs['choices'] = list(self.mapping.keys())
FinalizableAction.__init__(self, *args, **kwargs)
def _import(self, module, name):
diff --git a/src/lib/Bcfg2/Options/Options.py b/src/lib/Bcfg2/Options/Options.py
index c85cfd87c..b152c9899 100644
--- a/src/lib/Bcfg2/Options/Options.py
+++ b/src/lib/Bcfg2/Options/Options.py
@@ -26,7 +26,7 @@ def _debug(msg):
enabled by changing this to True. The verbosity here is primarily
of use to developers. """
if unit_test:
- print("DEBUG: %s" % msg)
+ print(("DEBUG: %s" % msg))
elif os.environ.get('BCFG2_OPTIONS_DEBUG', '0').lower() in ["true", "yes",
"on", "1"]:
sys.stderr.write("%s\n" % msg)
@@ -178,7 +178,7 @@ class Option(object):
determined that the default will be used (i.e., the option is
not given on the command line or in the config file) to store
the appropriate default value in the appropriate format."""
- for parser, action in self.actions.items():
+ for parser, action in list(self.actions.items()):
if hasattr(action, "finalize"):
if parser:
_debug("Finalizing %s for %s" % (self, parser))
@@ -276,7 +276,7 @@ class Option(object):
def _set_default(self, value):
""" Setter for the ``default`` property """
self._default = value
- for action in self.actions.values():
+ for action in list(self.actions.values()):
action.default = value
#: The current default value of this option
@@ -289,7 +289,7 @@ class Option(object):
def _set_dest(self, value):
""" Setter for the ``dest`` property """
self._dest = value
- for action in self.actions.values():
+ for action in list(self.actions.values()):
action.dest = value
def early_parsing_hook(self, early_opts): # pylint: disable=C0111
diff --git a/src/lib/Bcfg2/Options/Parser.py b/src/lib/Bcfg2/Options/Parser.py
index 51e41850c..e2573e74c 100644
--- a/src/lib/Bcfg2/Options/Parser.py
+++ b/src/lib/Bcfg2/Options/Parser.py
@@ -175,7 +175,7 @@ class Parser(argparse.ArgumentParser):
if not opt.args and opt.dest not in self.namespace:
value = opt.default
if value:
- for _, action in opt.actions.items():
+ for _, action in list(opt.actions.items()):
_debug("Setting config file-only option %s to %s" %
(opt, value))
action(self, self.namespace, value)
diff --git a/src/lib/Bcfg2/Options/Subcommands.py b/src/lib/Bcfg2/Options/Subcommands.py
index 2ba81e18d..f4ee207a9 100644
--- a/src/lib/Bcfg2/Options/Subcommands.py
+++ b/src/lib/Bcfg2/Options/Subcommands.py
@@ -151,17 +151,17 @@ class Help(Subcommand):
def run(self, setup):
commands = dict((name, cmd)
- for (name, cmd) in self._registry.commands.items()
+ for (name, cmd) in list(self._registry.commands.items())
if not cmd.only_interactive)
if setup.command:
try:
commands[setup.command].parser.print_help()
return 0
except KeyError:
- print("No such command: %s" % setup.command)
+ print(("No such command: %s" % setup.command))
return 1
for command in sorted(commands.keys()):
- print(commands[command].usage())
+ print((commands[command].usage()))
class CommandRegistry(object):
diff --git a/src/lib/Bcfg2/Options/Types.py b/src/lib/Bcfg2/Options/Types.py
index ad2e04f10..29cbb30d9 100644
--- a/src/lib/Bcfg2/Options/Types.py
+++ b/src/lib/Bcfg2/Options/Types.py
@@ -86,7 +86,7 @@ _bytes_multipliers = dict(k=1,
m=2,
g=3,
t=4)
-_suffixes = "".join(_bytes_multipliers.keys()).lower()
+_suffixes = "".join(list(_bytes_multipliers.keys())).lower()
_suffixes += _suffixes.upper()
_bytes_re = re.compile(r'(?P<value>\d+)(?P<multiplier>[%s])?' % _suffixes)
# pylint: enable=C0103