fix six.iteritems usage

This commit is contained in:
Brad Warren 2021-02-08 12:17:23 -08:00
parent 532520ab53
commit 63b903f67d
7 changed files with 9 additions and 9 deletions

View file

@ -470,7 +470,7 @@ class HelpfulArgumentParser(object):
may or may not be displayed as help topics.
"""
for name, plugin_ep in six.iteritems(plugins):
for name, plugin_ep in plugins.items():
parser_or_group = self.add_group(name,
description=plugin_ep.long_description)
plugin_ep.plugin_cls.inject_parser_options(parser_or_group, name)

View file

@ -215,7 +215,7 @@ class PluginsRegistry(Mapping):
# This prevents deadlock caused by plugins acquiring a lock
# and ensures at least one concurrent Certbot instance will run
# successfully.
self._plugins = collections.OrderedDict(sorted(six.iteritems(plugins)))
self._plugins = collections.OrderedDict(sorted(plugins.items()))
@classmethod
def find_all(cls):
@ -281,7 +281,7 @@ class PluginsRegistry(Mapping):
def filter(self, pred):
"""Filter plugins based on predicate."""
return type(self)({name: plugin_ep for name, plugin_ep
in six.iteritems(self._plugins) if pred(plugin_ep)})
in self._plugins.items() if pred(plugin_ep)})
def visible(self):
"""Filter plugins based on visibility."""

View file

@ -183,7 +183,7 @@ class Authenticator(common.Plugin):
for achall in achalls:
if achall in server_achalls:
server_achalls.remove(achall)
for port, servers in six.iteritems(self.servers.running()):
for port, servers in self.servers.running().items():
if not self.served[servers]:
self.servers.stop(port)

View file

@ -242,7 +242,7 @@ class _WebrootMapAction(argparse.Action):
"""Action class for parsing webroot_map."""
def __call__(self, parser, namespace, webroot_map, option_string=None):
for domains, webroot_path in six.iteritems(json.loads(webroot_map)):
for domains, webroot_path in json.loads(webroot_map).items():
webroot_path = _validate_webroot(webroot_path)
namespace.webroot_map.update(
(d, webroot_path) for d in cli.add_domains(namespace, domains))

View file

@ -155,7 +155,7 @@ def _restore_plugin_configs(config, renewalparams):
for plugin_prefix in set(plugin_prefixes):
plugin_prefix = plugin_prefix.replace('-', '_')
for config_item, config_value in six.iteritems(renewalparams):
for config_item, config_value in renewalparams.items():
if config_item.startswith(plugin_prefix + "_") and not cli.set_by_cli(config_item):
# Values None, True, and False need to be treated specially,
# As their types aren't handled correctly by configobj

View file

@ -275,7 +275,7 @@ def relevant_values(all_values):
rv = dict(
(option, value)
for option, value in six.iteritems(all_values)
for option, value in all_values.items()
if _relevant(namespaces, option) and cli.option_was_set(option, value))
# We always save the server value to help with forward compatibility
# and behavioral consistency when versions of Certbot with different

View file

@ -56,7 +56,7 @@ class PluginEntryPointTest(unittest.TestCase):
EP_SA: "sa",
}
for entry_point, name in six.iteritems(names):
for entry_point, name in names.items():
self.assertEqual(
name, PluginEntryPoint.entry_point_to_plugin_name(entry_point, with_prefix=False))
@ -70,7 +70,7 @@ class PluginEntryPointTest(unittest.TestCase):
self.ep3: "p3:ep3",
}
for entry_point, name in six.iteritems(names):
for entry_point, name in names.items():
self.assertEqual(
name, PluginEntryPoint.entry_point_to_plugin_name(entry_point, with_prefix=True))