mirror of
https://github.com/openSUSE/osc.git
synced 2025-09-05 20:58:42 +02:00
Add core.parse_meta_to_string helper to work around the insane implementation of core.meta_exists. Since core.meta_exists may return a list of bytes, a str, a list of str etc., we ultimately convert the data to str before passing it ET.fromstring(...). In case of bytes, the explicit decoding is OK because it is assumed to be a valid utf-8 encoding (the data represents an xml). Note: at the moment core.parse_meta_to_string is also called even if it is not necessary (it is only necessary if the "create" parameter of a corresponding core.meta_exists call is True). Note 2: this is just a temporary workaround and, eventually, we will make the implementation of core.meta_exists more reasonable. When doing so, we will also remove "public" function core.parse_meta_to_string again. (Yes, this breaks API but the core.meta_exists change will also break the API in some sense - so that's OK.)