def get_list_from_ranges_str(ranges_str):
    """Convert the range in string format to ranges list

    And yield the merged ranges in order. The argument must be a
    string having comma separated vlan and vlan-ranges.

    get_list_from_ranges_str("4,6,10-13,25-27,100-103")
    [4, 6, 10, 11, 12, 13, 25, 26, 27, 100, 101, 102, 103]
    """
    return sum(((list(range(*[int(range_start) + range_index
                              for range_index, range_start in
                              enumerate(range_item.split('-'))]))
                if '-' in range_item else [int(range_item)])
                for range_item in ranges_str.split(',')), [])