def alloc_vpcid(nexus_ips):
LOG.debug("<STR_LIT>")<EOL>vpc_id = <NUM_LIT:0><EOL>intersect = _get_free_vpcids_on_switches(nexus_ips)<EOL>for intersect_tuple in intersect:<EOL><INDENT>try:<EOL><INDENT>update_vpc_entry(nexus_ips, intersect_tuple.vpc_id,<EOL>False, True)<EOL>vpc_id = intersect_tuple.vpc_id<EOL>break<EOL><DEDENT>except Exception:<EOL><INDENT>LOG.exception(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>{'<STR_LIT>': intersect_tuple.vpc_id,<EOL>'<STR_LIT>': '<STR_LIT:U+002CU+0020>'.join(map(str, nexus_ips))})<EOL><DEDENT><DEDENT>return vpc_id<EOL>
Allocate a vpc id for the given list of switch_ips.