From 116bb21b0e9e104b798ec244d0d71d649ef4595c Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Wed, 25 May 2022 16:32:30 +0800 Subject: [PATCH] config_tools: fix move_enablement in the upgrader The EnablementType is now obsolete and config items having this type have been updated to use the Boolean type. However, the upgrader is not changed accordingly and it still converts "y" or "n" of certain config items to "Enable" or "Disable". This patch drops the EnablementType in the schema and updates the upgrader to respect the latest definitions. Tracked-On: #6690 Signed-off-by: Junjie Mao --- misc/config_tools/scenario_config/upgrader.py | 6 +++--- misc/config_tools/schema/types.xsd | 10 ---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/misc/config_tools/scenario_config/upgrader.py b/misc/config_tools/scenario_config/upgrader.py index ae28cb446..50a4422f5 100755 --- a/misc/config_tools/scenario_config/upgrader.py +++ b/misc/config_tools/scenario_config/upgrader.py @@ -594,13 +594,13 @@ class ScenarioUpgrader(ScenarioTransformer): return False - def move_enablement(self, xpath, xsd_element_node, xml_parent_node, new_nodes, values_as_enabled = ["y"], values_as_disabled = ["n"]): + def move_enablement(self, xpath, xsd_element_node, xml_parent_node, new_nodes, values_as_enabled = ["Enable"], values_as_disabled = ["Disable"]): ret = self.move_data_by_xpath(xpath, xsd_element_node, xml_parent_node, new_nodes) for n in new_nodes: if n.text in values_as_enabled: - n.text = "Enable" + n.text = "y" elif n.text in values_as_disabled: - n.text = "Disable" + n.text = "n" return ret def move_data_by_xpath(self, xpath, xsd_element_node, xml_parent_node, new_nodes, scenario_xml_only = False, launch_xml_only = False): diff --git a/misc/config_tools/schema/types.xsd b/misc/config_tools/schema/types.xsd index 8450fffae..e4e7eefc0 100644 --- a/misc/config_tools/schema/types.xsd +++ b/misc/config_tools/schema/types.xsd @@ -13,16 +13,6 @@ - - - A string with value: ``Enable`` or ``Disable``. - - - - - - -