[spp] [PATCH 3/5] controller: remove nouse check_sec_cmds
ogawa.yasufumi at lab.ntt.co.jp
ogawa.yasufumi at lab.ntt.co.jp
Mon Feb 4 04:11:59 CET 2019
From: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
`check_sec_cmds()` was used for validation of `sec` command which is
already replaced with `nfv`, `vf` or so. This update is to remove nouse
method.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
---
src/controller/shell.py | 37 -------------------------------------
1 file changed, 37 deletions(-)
diff --git a/src/controller/shell.py b/src/controller/shell.py
index 78795f7..e8b0a0e 100644
--- a/src/controller/shell.py
+++ b/src/controller/shell.py
@@ -203,43 +203,6 @@ class Shell(cmd.Cmd, object):
return True
return False
- def check_sec_cmds(self, cmds):
- """Validate secondary commands before sending"""
-
- # TODO(yasufum) change to return True or False, or None
- # instead of 0 or 1
-
- level1 = ['status', 'exit', 'forward', 'stop']
- level2 = ['add', 'patch', 'del']
- patch_args = ['reset']
- add_del_args = ['ring', 'vhost', 'pcap', 'nullpmd']
- cmdlist = cmds.split(' ')
- valid = 0
-
- length = len(cmdlist)
- if length == 1:
- if cmdlist[0] in level1:
- valid = 1
-
- elif length == 2:
- if cmdlist[0] == 'patch':
- if cmdlist[1] in patch_args:
- valid = 1
-
- elif cmdlist[0] == 'add' or cmdlist[0] == 'del':
- p_type, p_id = cmdlist[1].split(':')
- if p_type in add_del_args:
- if str.isdigit(p_id):
- valid = 1
-
- elif length == 3:
- if cmdlist[0] in level2:
- if cmdlist[0] == 'patch':
- if self.is_patched_ids_valid(cmdlist[1], cmdlist[2]):
- valid = 1
-
- return valid
-
def clean_cmd(self, cmdstr):
"""remove unwanted spaces to avoid invalid command error"""
--
2.7.4
More information about the spp
mailing list