of_config_cli: add delete_config and copy_config

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
YAMAMOTO Takashi 2013-12-19 16:17:58 +09:00 committed by FUJITA Tomonori
parent abfc1bd729
commit c5a3642464

View File

@ -171,6 +171,36 @@ class Cmd(cmd.Cmd):
self._request(line, f)
def do_delete_config(self, line):
"""delete_config <peer> <source>
eg. delete_config sw1 startup
"""
def f(p, args):
try:
source = args[0]
except:
print "argument error"
return
print p.delete_config(source)
self._request(line, f)
def do_copy_config(self, line):
"""copy_config <peer> <source> <target>
eg. copy_config sw1 running startup
"""
def f(p, args):
try:
source, target = args
except:
print "argument error"
return
print p.copy_config(source, target)
self._request(line, f)
def do_list_port(self, line):
"""list_port <peer>
"""