def _port_action_vlan(self, port, segment, func, vni):
<EOL>if not self._is_valid_segment(segment):<EOL><INDENT>return<EOL><DEDENT>device_id = self._get_port_uuid(port)<EOL>if nexus_help.is_baremetal(port):<EOL><INDENT>host_id = port.get('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>host_id = port.get(bc.portbindings.HOST_ID)<EOL><DEDENT>vlan_id = segment.get(api.SEGMENTATION_ID)<EOL>is_provider = nxos_db.is_provider_vlan(vlan_id)<EOL>settings = {"<STR_LIT>": vlan_id,<EOL>"<STR_LIT>": device_id,<EOL>"<STR_LIT>": host_id}<EOL>missing_fields = [field for field, value in settings.items()<EOL>if (field != '<STR_LIT>' and not value)]<EOL>if not missing_fields:<EOL><INDENT>func(port, vlan_id, device_id, host_id, vni, is_provider)<EOL><DEDENT>else:<EOL><INDENT>raise excep.NexusMissingRequiredFields(<EOL>fields='<STR_LIT:U+0020>'.join(missing_fields))<EOL><DEDENT>
Verify configuration and then process event.