'Batch startup for OVS
switches: switches to start up
run: function to run commands (errRun)'

@classmethod
def batchStartup(cls, switches, run=errRun):

    info('...')
    cmds = 'ovs-vsctl'
    for switch in switches:
        if switch.isOldOVS():
            run(('ovs-vsctl    del-br    %s' % switch))
        for cmd in switch.commands:
            cmd = cmd.strip()
            if ((len(cmds) + len(cmd)) >= cls.argmax):
                run(cmds, shell=True)
                cmds = 'ovs-vsctl'
            cmds += ('    ' + cmd)
            switch.cmds = []
            switch.batch = False
    if cmds:
        run(cmds, shell=True)
    for switch in switches:
        for intf in switch.intfs.itervalues():
            if isinstance(intf, TCIntf):
                intf.config(**intf.params)
    return switches
