fix flake8 issues

This commit is contained in:
Mike McLean
2021-04-21 14:35:24 -04:00
parent 023602578d
commit 865296b8c7
4 changed files with 11 additions and 12 deletions

View File

@@ -228,10 +228,10 @@ def import_builds_from_local_dnf_repos(platform_id=None):
if not platform_id:
# Parse the /etc/os-release to find out the local platform:stream.
with open("/etc/os-release", "r") as fd:
for l in fd.readlines():
if not l.startswith("PLATFORM_ID"):
for line in fd.readlines():
if not line.startswith("PLATFORM_ID"):
continue
platform_id = l.split("=")[1].strip("\"' \n")
platform_id = line.split("=")[1].strip("\"' \n")
if not platform_id:
raise ValueError("Cannot get PLATFORM_ID from /etc/os-release.")

View File

@@ -871,14 +871,14 @@ class Config(object):
)
self._messaging = s
def _setifok_amq_recv_addresses(self, l):
assert isinstance(l, list) or isinstance(l, tuple)
self._amq_recv_addresses = list(l)
def _setifok_amq_recv_addresses(self, values):
assert isinstance(values, list) or isinstance(values, tuple)
self._amq_recv_addresses = list(values)
def _setifok_scmurls(self, l):
if not isinstance(l, list):
def _setifok_scmurls(self, values):
if not isinstance(values, list):
raise TypeError("scmurls needs to be a list.")
self._scmurls = [str(x) for x in l]
self._scmurls = [str(x) for x in values]
def _setifok_num_concurrent_builds(self, i):
if not isinstance(i, int):

View File

@@ -438,7 +438,7 @@ def get_reusable_component(
# check that arches have not changed
pkg = mmd.get_rpm_component(component_name)
if set(pkg.get_arches()) != set(old_mmd.get_rpm_component(component_name).get_arches()):
message = ("Cannot reuse the component because its architectures"
message = ("Cannot reuse the component {0} because its architectures"
" have changed since the compatible module build").format(component_name)
new_module_build_component.log_message(db_session, message)
return None

View File

@@ -497,8 +497,7 @@ def _validate_stream_name_for_static_context(module, stream, context, dep_type):
if stream_type is not str:
raise ValidationError(("The module '{module}' in '{dep_type}' of the '{context}' "
"static context is of type '{stream_type}' should be "
"'str' type.").format(stream=stream,
module=module,
"'str' type.").format(module=module,
dep_type=dep_type,
context=context,
stream_type=stream_type))