Fix "reboot_required" and "unremovable" values inside metadata

This commits change metadata.py to correctly
read the values set on recipe's fields "reboot_required"
and "unremovable" when creating a patch.

Test Plan:
    PASS: Generate patch with "reboot_required" and
    "unremovable" set as "N".
    PASS: Generate patch with "reboot_required" and
    "unremovable" set as "Y".

Closes-bug: 2052458

Change-Id: I9ba5058b296a63d98685882cee66ef6aa21c4f02
Signed-off-by: Dostoievski Batista <dostoievski.albinobatista@windriver.com>
This commit is contained in:
Dostoievski Batista 2024-02-05 15:06:53 -03:00
parent 717297354a
commit 0136ecee29

View File

@ -109,15 +109,15 @@ class PatchMetadata(object):
self.__add_text_tag_to_xml(top_tag, WARNINGS, self.warnings)
self.__add_text_tag_to_xml(top_tag, STATUS, self.status)
if self.unremovable:
self.__add_text_tag_to_xml(top_tag, UNREMOVABLE, 'Y')
if self.unremovable.upper() in ["Y","N"]:
self.__add_text_tag_to_xml(top_tag, UNREMOVABLE, self.unremovable.upper())
else:
self.__add_text_tag_to_xml(top_tag, UNREMOVABLE, 'N')
raise Exception('Supported values for "Unremovable" are Y or N, for "Yes" or "No" respectively')
if self.reboot_required:
self.__add_text_tag_to_xml(top_tag, REBOOT_REQUIRED, 'Y')
if self.reboot_required.upper() in ["Y","N"]:
self.__add_text_tag_to_xml(top_tag, REBOOT_REQUIRED, self.reboot_required.upper())
else:
self.__add_text_tag_to_xml(top_tag, REBOOT_REQUIRED, 'N')
raise Exception('Supported values for "Reboot Required" are Y or N, for "Yes" or "No" respectively')
self.__add_text_tag_to_xml(top_tag, SEMANTICS, self.semantics)