def console_port_iterator():
    '''this iterator deals with the http_console_ports 
    returning the ports one by one
    '''
    index = 0
    while index < len(global_config["http_console_ports"]):
        port = global_config["http_console_ports"][index]
        #print "ports -> ", port
        if type(port) is int:
            yield port
        else: #this is dictionary with from to keys
            port2 = port["from"]
            #print "ports -> ", port, port2
            while port2 <= port["to"]:
                print "ports -> ", port, port2
                yield port2
                port2 += 1
        index += 1
dataset/ETHPy150Open nfvlabs/openmano/openmano/openmanod.py/console_port_iterator/original