acrn-config: fix the issue config app failed to generate patch for a new board

fix the issue: WebUI could not generate configuration patch for a new imported board

Tracked-On: #3760
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Shuang Zheng
2019-09-27 10:29:35 +08:00
committed by wenlingz
parent bdf3a89e6d
commit 4f9c2f3a7a
2 changed files with 12 additions and 3 deletions

View File

@@ -253,10 +253,11 @@ class XmlConfig:
raise Exception('can not find node by {} from xml'.format(args))
def save(self, xml=None):
def save(self, xml=None, user_defined=True):
"""
save current xml to file.
:param xml: the file name to save; if not specified, save current xml to default names.
:param user_defined: save to user defined folder or default folder.
:return: None.
"""
if self._curr_xml_tree is None:
@@ -264,7 +265,9 @@ class XmlConfig:
if xml is None:
xml = self._curr_xml
xml_path = os.path.join(self._xml_path, 'user_defined')
xml_path = self._xml_path
if user_defined:
xml_path = os.path.join(self._xml_path, 'user_defined')
if not os.path.isdir(xml_path):
os.makedirs(xml_path)