Hide Forgot
Description of problem: (fully updated f8 box) mock-0.8.19-1.fc8 When set in a mock config file eg config_opts['macros'] = '%vendor me\n%_topdir builddir/build\n%_rpmfilename%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm\n%_host i386-linux-gnu\n%packager mr.trouble\n%distribution Unknown\n%_host_cpu i386' (or even just as config_opts['macros'] = '') mock seems to have issues as follows ERROR: 'str' object has no attribute 'items' Traceback (most recent call last): File "/usr/libexec/mock.py", line 593, in <module> main(retParams) File "/usr/libexec/mock.py", line 538, in main do_rebuild(config_opts, chroot, args) File "<peak.util.decorators.rewrap wrapping __main__.do_rebuild at 0x008CE1B8>", line 3, in do_rebuild def do_rebuild(config_opts, chroot, srpms): return __decorated(config_opts, chroot, srpms) File "/usr/lib/python2.5/site-packages/mock/trace_decorator.py", line 70, in trace result = func(*args, **kw) File "/usr/libexec/mock.py", line 342, in do_rebuild chroot.init() File "<peak.util.decorators.rewrap wrapping mock.backend.init at 0x008BC1B8>", line 3, in init def init(self): return __decorated(self) File "/usr/lib/python2.5/site-packages/mock/trace_decorator.py", line 70, in trace result = func(*args, **kw) File "/usr/lib/python2.5/site-packages/mock/backend.py", line 257, in init self._buildDirSetup() File "<peak.util.decorators.rewrap wrapping mock.backend._buildDirSetup at 0x008C5488>", line 3, in _buildDirSetup def _buildDirSetup(self): return __decorated(self) File "/usr/lib/python2.5/site-packages/mock/trace_decorator.py", line 70, in trace result = func(*args, **kw) File "/usr/lib/python2.5/site-packages/mock/backend.py", line 558, in _buildDirSetup for key, value in self.macros.items(): AttributeError: 'str' object has no attribute 'items' Dropping the config_opts['macros'] directive from the mock.cfg file works so am I doing something seriously dumb (though that macro line is passed by koji so it probably is correctly formatted though I'm guessing thats not really the issue here) /usr/lib/python2.5/site-packages/mock/backend.py +558 # rpmmacros default macrofile_out = self.makeChrootPath(self.homedir, ".rpmmacros") rpmmacros = open(macrofile_out, 'w+') for key, value in self.macros.items(): rpmmacros.write( "%s %s\n" % (key, value) ) rpmmacros.close() Phil (python weenie) =--=
Format for the macros var changed in like, 0.8.0 or something. /etc/mock/defaults.cfg has an example of the syntax.
mock-0.8.19-1.fc8 koji-1.2.2-2.fc8 config_opts['macros']['Add_your_macro_name_here'] = "add macro value here" ooook,.. well that makes sense. Right, looks like there is a disconnect between what the koji folk are getting their code to generate vs what current mock expects I guess this bug should be shifted over the the koji package (trying to shift the bug over so don't scream too loudly if this update fails to do that) Phil =--=
Koji 1.2.2 is known not to work with later mock releases. Mock 0.9.x and koji 1.2.3 or later are needed. This will be resolved in the next release.
Should have been closed a while back after 1.2.3 went out. closing. Phil =--=