'Update rules for given port
Current existing filtering rules are removed and new ones are generated
based on current loaded security group rules and members.'

def update_port_filter(self, port):

    if (not firewall.port_sec_enabled(port)):
        self.remove_port_filter(port)
        self._initialize_egress_no_port_security(port['device'])
        return
    elif (not self.is_port_managed(port)):
        self._remove_egress_no_port_security(port['device'])
        self.prepare_port_filter(port)
        return
    old_of_port = self.get_ofport(port)
    of_port = self.get_or_create_ofport(port)
    self.delete_all_port_flows(old_of_port)
    self.initialize_port_flows(of_port)
    self.add_flows_from_rules(of_port)
