def _restore_vxlan_entries(self, switch_ip, vlans):
count = <NUM_LIT:1><EOL>conf_str = '<STR_LIT>'<EOL>vnsegment_sent = <NUM_LIT:0><EOL>path_str, conf_str = self.driver.start_create_vlan()<EOL>while vnsegment_sent < const.CREATE_VLAN_BATCH and vlans:<EOL><INDENT>vlan_id, vni = vlans.pop(<NUM_LIT:0>)<EOL>conf_str = self.driver.get_create_vlan(<EOL>switch_ip, vlan_id, vni, conf_str)<EOL>if (count == const.CREATE_VLAN_SEND_SIZE):<EOL><INDENT>conf_str = self.driver.end_create_vlan(conf_str)<EOL>self.driver.send_edit_string(switch_ip, path_str, conf_str)<EOL>vnsegment_sent += count<EOL>conf_str = '<STR_LIT>'<EOL>count = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>count += <NUM_LIT:1><EOL><DEDENT><DEDENT>if conf_str:<EOL><INDENT>vnsegment_sent += count<EOL>conf_str = self.driver.end_create_vlan(conf_str)<EOL>self.driver.send_edit_string(switch_ip, path_str, conf_str)<EOL>conf_str = '<STR_LIT>'<EOL><DEDENT>LOG.debug("<STR_LIT>",<EOL>switch_ip, vnsegment_sent)<EOL>
Restore vxlan entries on a Nexus switch.