def update_condition(idl, commands): commands = commands[len("condition "):].split(";") for command in commands: command = command.split(" ") if(len(command) != 2): sys.stderr.write("Error parsing condition %s\n" % command) sys.exit(1) table = command[0] cond = ovs.json.from_string(command[1]) idl.cond_change(table, cond)
def update_condition(idl, commands): commands = commands[len("condition "):].split(";") for command in commands: command = command.split(" ") if (len(command) != 2): sys.stderr.write("Error parsing condition %s\n" % command) sys.exit(1) table = command[0] cond = ovs.json.from_string(command[1]) idl.cond_change(table, cond)
def update_condition(idl, commands): commands = commands.split(";") for command in commands: command = command[len("condition "):] if "add" in command: add_cmd = True command = command[len("add "):] else: add_cmd = False command = command[len("remove "):] command = command.split(" ") if(len(command) != 2): sys.stderr.write("Error parsong condition %s\n" % command) sys.exit(1) table = command[0] cond = ovs.json.from_string(command[1]) idl.cond_change(table, add_cmd, cond)
def update_condition(idl, commands): commands = commands.split(";") for command in commands: command = command[len("condition "):] if "add" in command: add_cmd = True command = command[len("add "):] else: add_cmd = False command = command[len("remove "):] command = command.split(" ") if (len(command) != 2): sys.stderr.write("Error parsong condition %s\n" % command) sys.exit(1) table = command[0] cond = ovs.json.from_string(command[1]) idl.cond_change(table, add_cmd, cond)