Upgrade black version (#424)

Upgrade black version

SUMMARY

Move off of beta version of black and pin to current calendar year
version.
The only manual changes here are to tox.ini. Everything else is from running the new version of black.

ISSUE TYPE

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Abhijeet Kasurde <None>
This commit is contained in:
Mike Graves
2022-03-30 11:02:46 -04:00
committed by GitHub
parent 0299aa8807
commit 7c71436f3b
16 changed files with 110 additions and 62 deletions

View File

@@ -96,7 +96,7 @@ class Discoverer(kubernetes.dynamic.discovery.Discoverer):
self._write_cache()
def get_resources_for_api_version(self, prefix, group, version, preferred):
""" returns a dictionary of resources associated with provided (prefix, group, version)"""
"""returns a dictionary of resources associated with provided (prefix, group, version)"""
resources = defaultdict(list)
subresources = defaultdict(dict)

View File

@@ -473,9 +473,11 @@ class K8sAnsibleMixin(object):
if result_empty(result):
res = dict(resources=[], api_found=True)
if last_exception is not None:
res["msg"] = (
"Exception '%s' raised while trying to get resource using %s"
% (last_exception, params)
res[
"msg"
] = "Exception '%s' raised while trying to get resource using %s" % (
last_exception,
params,
)
return res

View File

@@ -385,8 +385,10 @@ def check_pod(k8s_ansible_mixin, module):
def _fail(exc):
arg = {}
if hasattr(exc, "body"):
msg = "Namespace={0} Kind=Pod Name={1}: Failed requested object: {2}".format(
namespace, name, exc.body
msg = (
"Namespace={0} Kind=Pod Name={1}: Failed requested object: {2}".format(
namespace, name, exc.body
)
)
else:
msg = to_native(exc)

View File

@@ -19,4 +19,4 @@ __metaclass__ = type
class ApplyException(Exception):
""" Could not apply patch """
"""Could not apply patch"""