From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 3/5] controller: remove nouse check_sec_cmds
Date: Mon, 4 Feb 2019 12:11:59 +0900 [thread overview]
Message-ID: <1549249921-31638-4-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1549249921-31638-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@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@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
next prev parent reply other threads:[~2019-02-04 3:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-04 3:11 [spp] [PATCH 0/5] Add config command ogawa.yasufumi
2019-02-04 3:11 ` [spp] [PATCH 1/5] controller: add " ogawa.yasufumi
2019-02-04 3:11 ` [spp] [PATCH 2/5] controller: refactor pri launch command ogawa.yasufumi
2019-02-04 3:11 ` ogawa.yasufumi [this message]
2019-02-04 3:12 ` [spp] [PATCH 4/5] controller: add max_secondary to config ogawa.yasufumi
2019-02-04 3:12 ` [spp] [PATCH 5/5] controller: change nof worker lcores configurable ogawa.yasufumi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1549249921-31638-4-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
--to=ogawa.yasufumi@lab.ntt.co.jp \
--cc=ferruh.yigit@intel.com \
--cc=spp@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).