From c1dbe9be275cf90e1e8df88f8b2f42426acb1a44 Mon Sep 17 00:00:00 2001 From: mprahl Date: Mon, 11 Dec 2017 13:50:45 -0500 Subject: [PATCH] Remove unused yaml argument in utils.submit_module_build --- module_build_service/utils.py | 10 +++++----- tests/test_utils/test_utils.py | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/module_build_service/utils.py b/module_build_service/utils.py index d0cdc43e..d5194638 100644 --- a/module_build_service/utils.py +++ b/module_build_service/utils.py @@ -936,8 +936,8 @@ def record_component_builds(mmd, module, initial_batch=1, def submit_module_build_from_yaml(username, handle, stream=None, skiptests=False, optional_params=None): - yaml = handle.read() - mmd = load_mmd(yaml) + yaml_file = handle.read() + mmd = load_mmd(yaml_file) # Mimic the way how default values are generated for modules that are stored in SCM # We can take filename as the module name as opposed to repo name, @@ -952,7 +952,7 @@ def submit_module_build_from_yaml(username, handle, stream=None, skiptests=False if skiptests: mmd.buildopts.rpms.macros += "\n\n%__spec_check_pre exit 0\n" - return submit_module_build(username, None, mmd, None, yaml, optional_params) + return submit_module_build(username, None, mmd, None, optional_params) _url_check_re = re.compile(r"^[^:/]+:.*$") @@ -968,10 +968,10 @@ def submit_module_build_from_scm(username, url, branch, allow_local_url=False, url = "file://" + url mmd, scm = _fetch_mmd(url, branch, allow_local_url) - return submit_module_build(username, url, mmd, scm, yaml, optional_params) + return submit_module_build(username, url, mmd, scm, optional_params) -def submit_module_build(username, url, mmd, scm, yaml, optional_params=None): +def submit_module_build(username, url, mmd, scm, optional_params=None): import koji # Placed here to avoid py2/py3 conflicts... # Import it here, because SCM uses utils methods diff --git a/tests/test_utils/test_utils.py b/tests/test_utils/test_utils.py index 084d17ef..ef993e4d 100644 --- a/tests/test_utils/test_utils.py +++ b/tests/test_utils/test_utils.py @@ -698,10 +698,8 @@ class TestUtils(unittest.TestCase): mock_submit_args = mock_submit.call_args[0] username_arg = mock_submit_args[0] mmd_arg = mock_submit_args[2] - modulemd_yaml_arg = mock_submit_args[4] assert mmd_arg.stream == stream assert "\n\n%__spec_check_pre exit 0\n" in mmd_arg.buildopts.rpms.macros - assert modulemd_yaml_arg == modulemd_yaml assert username_arg == username rmtree(module_dir)