From 254195a4d04889f1d0bce5ceb9d1e68503541dec Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Nov 06 2018 08:46:39 +0000 Subject: Remove unused variable local_modules from format_mmd Signed-off-by: Chenxiong Qi --- diff --git a/module_build_service/utils/submit.py b/module_build_service/utils/submit.py index 2a22449..babe895 100644 --- a/module_build_service/utils/submit.py +++ b/module_build_service/utils/submit.py @@ -112,7 +112,7 @@ def _scm_get_latest(pkg): } -def format_mmd(mmd, scmurl, session=None): +def format_mmd(mmd, scmurl): """ Prepares the modulemd for the MBS. This does things such as replacing the branches of components with commit hashes and adding metadata in the xmd @@ -124,9 +124,6 @@ def format_mmd(mmd, scmurl, session=None): # them because of dep-chain. from module_build_service.scm import SCM - if not session: - session = db.session - xmd = glib.from_variant_dict(mmd.get_xmd()) if 'mbs' not in xmd: xmd['mbs'] = {} @@ -135,9 +132,6 @@ def format_mmd(mmd, scmurl, session=None): if 'commit' not in xmd['mbs']: xmd['mbs']['commit'] = '' - local_modules = models.ModuleBuild.local_modules(session) - local_modules = {m.name + "-" + m.stream: m for m in local_modules} - # If module build was submitted via yaml file, there is no scmurl if scmurl: scm = SCM(scmurl) @@ -300,7 +294,7 @@ def record_component_builds(mmd, module, initial_batch=1, # Format the modulemd by putting in defaults and replacing streams that # are branches with commit hashes - format_mmd(mmd, module.scmurl, session=session) + format_mmd(mmd, module.scmurl) # When main_mmd is set, merge the metadata from this mmd to main_mmd, # otherwise our current mmd is main_mmd.