ukify: fix parsing of SignTool configuration option
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 18 Nov 2024 12:35:38 +0000 (13:35 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 18 Nov 2024 14:58:41 +0000 (14:58 +0000)
commit5e7e4e4d49f38f8ceeef95ae8ea026abfa72cf73
tree592a3a3dd14ce064fb398cfe492151f8113106a8
parent4d9cac56db1d74908e278d016f0520f5d2f6af0f
ukify: fix parsing of SignTool configuration option

This partially reverts 02eabaffe98c9a3b5dec1c4837968a4d3e2ff7db.
As noted in https://github.com/systemd/systemd/pull/35211:
> The configuration parsing simply stores the string as-is, rather than
> creating the appropriate object

One way to fix the issue would be to store the "appropriate object", i.e.
actually the class. But that makes the code very verbose, with the conversion
being done in two places. And that still doesn't fix the issue, because we need
to map the class objects back to the original name in error messages.

So instead, store the setting as a string and only map it to the class much
later. This makes the code simpler and fixes the error messages too.

Resolves https://github.com/systemd/systemd/pull/35193
src/ukify/test/test_ukify.py
src/ukify/ukify.py