> They are necessary for switches that don't support the feature of
> modifying 'running' configuration directly; instead, needs to modify
> 'candidate' configuration and then commit (or discard).
> 
> Also fix do_get method's comment typo.
> 
> Signed-off-by: FUJITA Tomonori <[email protected]>

looks good to me.  thanks.

Reviewed-by: YAMAMOTO Takashi <[email protected]>

> ---
>  ryu/cmd/of_config_cli.py            | 22 +++++++++++++++++++++-
>  ryu/lib/of_config/capable_switch.py |  6 ++++++
>  2 files changed, 27 insertions(+), 1 deletion(-)
> 
> diff --git a/ryu/cmd/of_config_cli.py b/ryu/cmd/of_config_cli.py
> index 04596ac..cd01c5c 100755
> --- a/ryu/cmd/of_config_cli.py
> +++ b/ryu/cmd/of_config_cli.py
> @@ -143,7 +143,7 @@ class Cmd(cmd.Cmd):
>  
>      def do_get(self, line):
>          """get <peer>
> -        eg. get_config sw1
> +        eg. get sw1
>          """
>  
>          def f(p, args):
> @@ -151,6 +151,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 7be3159..91f4013 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
> -- 
> 1.8.3.4 (Apple Git-47)
> 
> 
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to