PR#4268: ensure macros and env values passed to mock are strings

Merges #4268
https://pagure.io/koji/pull-request/4268

Fixes: #4279
https://pagure.io/koji/issue/4279
Mock can error if a non-string is placed in the config
This commit is contained in:
Tomas Kopecek 2025-04-29 16:19:16 +02:00
commit 023e5d0e46

View file

@ -332,9 +332,9 @@ class BuildRoot(object):
for key in self.config['extra']:
if key.startswith('rpm.macro.'):
macro = '%' + key[10:]
opts['tag_macros'][macro] = self.config['extra'][key]
opts['tag_macros'][macro] = str(self.config['extra'][key])
elif key.startswith('rpm.env.'):
opts['tag_envvars'][key[8:]] = self.config['extra'][key]
opts['tag_envvars'][key[8:]] = str(self.config['extra'][key])
if 'mock.use_bootstrap' in self.config['extra']:
opts['use_bootstrap'] = bool(self.config['extra']['mock.use_bootstrap'])