Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com
Cc: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Subject: [spp] [PATCH 6/9] controller: update Shell for topo_subgraph
Date: Mon, 12 Mar 2018 14:35:21 +0900	[thread overview]
Message-ID: <1520832924-28387-7-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1520832924-28387-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

Update do_topo_subgraph() for parsing delimiter. It also update help
message.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/controller/shell.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/controller/shell.py b/src/controller/shell.py
index 4bca3e5..c379c2a 100644
--- a/src/controller/shell.py
+++ b/src/controller/shell.py
@@ -550,17 +550,15 @@ class Shell(cmd.Cmd, object):
         For topo command, it is used for grouping resources of each
         of VM or container to topology be more understandable.
 
-        Add subgraph labeled 'vm1'. Resource name is capitalized and
-        both of them is OK.
-        spp > topo_subgraph add vm1 VHOST1;VHOST2  # upper case
-        spp > topo_subgraph add vm1 vhost1;vhost2  # lower case
+        Add subgraph labeled 'vm1'.
+        spp > topo_subgraph add vm1 vhost:1;vhost:2
 
         Delete subgraph 'vm1'.
         spp > topo_subgraph del vm1
 
         To show subgraphs, run topo_subgraph without args.
         spp > topo_subgraph
-        {'vm1', 'VHOST1;VHOST2'}
+        label: vm1	subgraph: "vhost:1;vhost:2"
         """
 
         args_cleaned = re.sub(r"\s+", ' ', args).strip()
@@ -577,8 +575,11 @@ class Shell(cmd.Cmd, object):
             if tokens[0] == 'add':
                 if len(tokens) == 3:
                     label = tokens[1]
-                    subg = tokens[2].upper()
+                    subg = tokens[2]
                     if ',' in subg:
+                        subg = re.sub(
+                            r'%s' % spp_common.delim_node,
+                            spp_common.delim_label, subg)
                         subg = re.sub(r",", ";", subg)
 
                     # TODO(yasufum) add validation for subgraph
-- 
2.7.4

  parent reply	other threads:[~2018-03-12  5:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01  9:28 [spp] Port ID incrementation is changed from DPDK18.02 Yasufumi Ogawa
2018-03-12  5:35 ` [spp] [PATCH 0/9] Update port management ogawa.yasufumi
2018-03-12  5:35   ` [spp] [PATCH 1/9] controller: change displaying status ogawa.yasufumi
2018-03-12  5:35   ` [spp] [PATCH 2/9] shared: update print_active_ports ogawa.yasufumi
2018-03-12  5:35   ` [spp] [PATCH 3/9] spp_nfv: change format displaying status ogawa.yasufumi
2018-03-12  5:35   ` [spp] [PATCH 4/9] spp_vm: " ogawa.yasufumi
2018-03-12  5:35   ` [spp] [PATCH 5/9] controller: add delimiter for topo command ogawa.yasufumi
2018-03-12  5:35   ` ogawa.yasufumi [this message]
2018-03-12  5:35   ` [spp] [PATCH 7/9] controller: update generating graph ogawa.yasufumi
2018-03-12  5:35   ` [spp] [PATCH 8/9] controller: update topo command ogawa.yasufumi
2018-03-12  5:35   ` [spp] [PATCH 9/9] shared: fix bug for print port status ogawa.yasufumi
2018-03-27 23:51   ` [spp] [PATCH 0/9] Update port management Ferruh Yigit

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=1520832924-28387-7-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).