The code below seems to be checking port_set_ rather than have_port.