示例#1
0
def get_sub_leaf_tag(config_file, branch_tag, tag_str):
    """
     This is get tag value by tag_str from config file
     :param config_file: it is a file what contains information for script to read from
     :param branch_tag: it is key of patter to config file branch tag item
     :param tag_str: it is key of pattern to config file leaf tag item
     :return: value of tag_str item
     """
    return common.get_leaf_tag_val(config_file, branch_tag, tag_str)
def vmid_map_epc(config_file, tag, item):
    """
    This is mapping table for {id:item}
    :param config_file: it is a file what contains information for script to read from
    :param item: the item in xml file
    :return: table of id:item type dictionary
    """
    epc_order = {}
    vm_cnt = VM_COUNT

    item_list = common.get_leaf_tag_val(config_file, tag, item)
    load_type_list = common.get_branch_tag_val(config_file, "load_order")

    if 'SOS_VM' in load_type_list:
        vm_cnt = VM_COUNT - 1
    for i in range(vm_cnt):
        epc_order[i] = item_list[i]

    return epc_order