mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-02 20:59:06 +08:00
PR#1698: fix flake8 issues
Merges #1698 https://pagure.io/fm-orchestrator/pull-request/1698 Fixes: #1687 https://pagure.io/fm-orchestrator/issue/1687 flake8 failures on master
This commit is contained in:
@@ -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.")
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -22,7 +22,7 @@ c3i_build_custom_parameters:
|
||||
- name: MBS_FRONTEND_IMAGESTREAM_NAME
|
||||
value: mbs-frontend
|
||||
- name: MBS_SPEC_FILE
|
||||
value: https://src.fedoraproject.org/rpms/module-build-service/raw/master/f/module-build-service.spec
|
||||
value: https://src.fedoraproject.org/rpms/module-build-service/raw/main/f/module-build-service.spec
|
||||
- name: EXTRA_REPOS
|
||||
value: https://copr.fedorainfracloud.org/coprs/mikeb/mbs-messaging-umb/repo/fedora-31/mikeb-mbs-messaging-umb-fedora-31.repo
|
||||
- name: EXTRA_RPMS
|
||||
|
||||
@@ -40,5 +40,3 @@ def test_v3_buildrequire(mbs, clone_and_start_build):
|
||||
continue
|
||||
assert buildrequire in contexts[ctx]["buildrequires"]
|
||||
assert data["stream"] == contexts[ctx]["buildrequires"][buildrequire][0]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user