diff options
-rwxr-xr-x | ryu/cmd/of_config_cli.py | 22 | ||||
-rw-r--r-- | ryu/lib/of_config/capable_switch.py | 6 |
2 files changed, 27 insertions, 1 deletions
diff --git a/ryu/cmd/of_config_cli.py b/ryu/cmd/of_config_cli.py index 15f10c7b..6973b80f 100755 --- a/ryu/cmd/of_config_cli.py +++ b/ryu/cmd/of_config_cli.py @@ -142,7 +142,7 @@ class Cmd(cmd.Cmd): def do_get(self, line): """get <peer> - eg. get_config sw1 + eg. get sw1 """ def f(p, args): @@ -150,6 +150,26 @@ class Cmd(cmd.Cmd): self._request(line, f) + def do_commit(self, line): + """commit <peer> + eg. commit sw1 + """ + + def f(p, args): + print p.commit() + + self._request(line, f) + + def do_discard(self, line): + """discard <peer> + eg. discard sw1 + """ + + def f(p, args): + print p.discard_changes() + + self._request(line, f) + def do_get_config(self, line): """get_config <peer> <source> eg. get_config sw1 startup diff --git a/ryu/lib/of_config/capable_switch.py b/ryu/lib/of_config/capable_switch.py index 7be3159f..91f40134 100644 --- a/ryu/lib/of_config/capable_switch.py +++ b/ryu/lib/of_config/capable_switch.py @@ -123,5 +123,11 @@ class OFCapableSwitch(object): def copy_config(self, source, target): self.netconf.copy_config(source, target) + def commit(self): + self.netconf.commit() + + def discard_changes(self): + self.netconf.discard_changes() + # TODO: more netconf operations # TODO: convinience(higher level) methods |