def get_list_from_varconfigfile(string, varconfigfile, start_pat="${", end_pat="}"):
""" """
try:
# when varconfigfile is an XMl object(root element) - this happens
# only when varconfigfile is taken from database server
if isinstance(varconfigfile, ElementTree.Element) is True:
cfg_elem_obj = ConfigurationElement("Varconfig_from_database",
start_pat, end_pat)
cfg_elem_obj.parse_data(varconfigfile, elem_type="xml_object")
else:
cfg_elem_obj = ConfigurationElement(varconfigfile, start_pat, end_pat)
cfg_elem_obj.parse_data(varconfigfile)
newstring = cfg_elem_obj.get_list(string)
except TypeError as exception:
print_info("At least one of the variables in command string is not found in " + varconfigfile)
#print_exception(exception)
return False
return newstring
评论列表
文章目录