mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-09 00:03:17 +08:00
Merge #430 Delete get_module_runtime_dependencies
This commit is contained in:
@@ -38,7 +38,7 @@ import moksha.hub.reactor
|
||||
from module_build_service import app, conf, db
|
||||
from module_build_service import models
|
||||
from module_build_service.pdc import (
|
||||
get_pdc_client_session, get_module, get_module_runtime_dependencies,
|
||||
get_pdc_client_session, get_module,
|
||||
get_module_tag, get_module_build_dependencies)
|
||||
from module_build_service.utils import (
|
||||
submit_module_build_from_scm,
|
||||
@@ -100,29 +100,6 @@ def _establish_ssl_context():
|
||||
return ssl_ctx
|
||||
|
||||
|
||||
@manager.command
|
||||
def testpdc():
|
||||
""" A helper function to test PDC interaction
|
||||
"""
|
||||
cfg = conf
|
||||
cfg.pdc_url = "http://modularity.fedorainfracloud.org:8080/rest_api/v1"
|
||||
cfg.pdc_insecure = True
|
||||
cfg.pdc_develop = True
|
||||
|
||||
pdc_session = get_pdc_client_session(cfg)
|
||||
module = get_module(pdc_session, {'name': 'testmodule', 'version': '4.3.43',
|
||||
'release': '1'})
|
||||
|
||||
if module:
|
||||
print("pdc_data=%s" % str(module))
|
||||
print("deps=%s" % get_module_runtime_dependencies(pdc_session, module))
|
||||
print("build_deps=%s" % get_module_build_dependencies(
|
||||
pdc_session, module))
|
||||
print("tag=%s" % get_module_tag(pdc_session, module))
|
||||
else:
|
||||
print('module was not found')
|
||||
|
||||
|
||||
@console_script_help
|
||||
@manager.command
|
||||
def upgradedb():
|
||||
|
||||
@@ -331,27 +331,6 @@ def module_depsolving_wrapper(session, modules, strict=True):
|
||||
return list(module_tags)
|
||||
|
||||
|
||||
def get_module_runtime_dependencies(session, module_info, strict=False):
|
||||
"""
|
||||
:param session : PDCClient instance
|
||||
:param module_info : a dict containing filters for pdc
|
||||
:param strict: Normally this function returns None if no module can be
|
||||
found. If strict=True, then a ValueError is raised.
|
||||
|
||||
Example minimal module_info {'variant_id': module_name, 'variant_version': module_version, 'variant_type': 'module'}
|
||||
"""
|
||||
log.debug("get_module_runtime_dependencies(%r, strict=%r)" % (module_info, strict))
|
||||
# XXX get definitive list of modules
|
||||
|
||||
deps = []
|
||||
module_info = get_module(session, module_info, strict=strict)
|
||||
if module_info and module_info.get('runtime_deps', None):
|
||||
deps = [dict(variant_id=x['dependency'], variant_stream=x['stream'])
|
||||
for x in module_info['runtime_deps']]
|
||||
deps = module_depsolving_wrapper(session, deps, strict=strict)
|
||||
|
||||
return deps
|
||||
|
||||
def get_module_build_dependencies(session, module_info, strict=False):
|
||||
"""
|
||||
:param session : PDCClient instance
|
||||
|
||||
Reference in New Issue
Block a user