Update from upstream #11

Closed
soksanichenko wants to merge 158 commits from a8_updated into a8
3 changed files with 18 additions and 7 deletions
Showing only changes of commit 364ed6c3af - Show all commits

View File

@ -651,6 +651,10 @@ def _make_lookaside_repo(compose, variant, arch, pkg_map, package_sets=None):
compose compose
).koji_module.config.topdir.rstrip("/") ).koji_module.config.topdir.rstrip("/")
+ "/", + "/",
"kojimock": lambda: pungi.wrappers.kojiwrapper.KojiMockWrapper(
compose
).koji_module.config.topdir.rstrip("/")
+ "/",
} }
path_prefix = prefixes[compose.conf["pkgset_source"]]() path_prefix = prefixes[compose.conf["pkgset_source"]]()
package_list = set() package_list = set()

View File

@ -868,10 +868,13 @@ class KojiWrapper(object):
class KojiMockWrapper(object): class KojiMockWrapper(object):
lock = threading.Lock() lock = threading.Lock()
def __init__(self, profile): def __init__(self, compose):
self.profile = profile try:
self.profile = self.compose.conf["koji_profile"]
except KeyError:
raise RuntimeError("Koji profile must be configured")
with self.lock: with self.lock:
self.koji_module = koji.get_profile_module(profile) self.koji_module = koji.get_profile_module(self.profile)
session_opts = {} session_opts = {}
for key in ( for key in (
"timeout", "timeout",
@ -891,7 +894,11 @@ class KojiMockWrapper(object):
session_opts[key] = value session_opts[key] = value
self.koji_proxy = KojiMock( self.koji_proxy = KojiMock(
packages_dir=self.koji_module.config.topdir, packages_dir=self.koji_module.config.topdir,
modules_dir=os.path.join(self.koji_module.config.topdir, 'modules')) modules_dir=os.path.join(
self.koji_module.config.topdir,
'modules',
)
)
def get_buildroot_rpms(compose, task_id): def get_buildroot_rpms(compose, task_id):

View File

@ -110,13 +110,13 @@ class TestModulesYamlParser(TestCase):
os.listdir(os.path.join(PATH_TO_KOJI, 'module_defaults'))) os.listdir(os.path.join(PATH_TO_KOJI, 'module_defaults')))
# check that modules were exported # check that modules were exported
self.assertEqual(MARIADB_MODULE, yaml.load( self.assertEqual(MARIADB_MODULE, yaml.safe_load(
open(os.path.join(PATH_TO_KOJI, 'modules/x86_64', 'mariadb-devel-10.3_1-8010020200108182321.cdc1202b')))) open(os.path.join(PATH_TO_KOJI, 'modules/x86_64', 'mariadb-devel-10.3_1-8010020200108182321.cdc1202b'))))
self.assertEqual(JAVAPACKAGES_TOOLS_MODULE, yaml.load( self.assertEqual(JAVAPACKAGES_TOOLS_MODULE, yaml.safe_load(
open(os.path.join(PATH_TO_KOJI, 'modules/x86_64', 'javapackages-tools-201801-8000020190628172923.b07bea58')))) open(os.path.join(PATH_TO_KOJI, 'modules/x86_64', 'javapackages-tools-201801-8000020190628172923.b07bea58'))))
# check that defaults were copied # check that defaults were copied
self.assertEqual(ANT_DEFAULTS, yaml.load( self.assertEqual(ANT_DEFAULTS, yaml.safe_load(
open(os.path.join(PATH_TO_KOJI, 'module_defaults', 'ant.yaml')))) open(os.path.join(PATH_TO_KOJI, 'module_defaults', 'ant.yaml'))))