From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mogw0139.ocn.ad.jp (mogw0139.ocn.ad.jp [118.23.109.113]) by dpdk.org (Postfix) with ESMTP id 9D7D54C8F for ; Mon, 12 Mar 2018 06:35:40 +0100 (CET) Received: from mf-smf-ucb029c2 (mf-smf-ucb029c2.ocn.ad.jp [153.153.66.195]) by mogw0139.ocn.ad.jp (Postfix) with ESMTP id 1125E802AB; Mon, 12 Mar 2018 14:35:39 +0900 (JST) Received: from ntt.pod01.mv-mta-ucb029 ([153.149.230.163]) by mf-smf-ucb029c2 with ESMTP id vG7SeNBdMoJV6vG7XetIoK; Mon, 12 Mar 2018 14:35:39 +0900 Received: from smtp.ocn.ne.jp ([153.149.227.165]) by ntt.pod01.mv-mta-ucb029 with id Ltbe1x00Q3akymp01tbe5E; Mon, 12 Mar 2018 05:35:39 +0000 Received: from linaloe.flets-east.jp (sp1-66-103-93.msc.spmode.ne.jp [1.66.103.93]) by smtp.ocn.ne.jp (Postfix) with ESMTPA; Mon, 12 Mar 2018 14:35:38 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com Cc: Yasufumi Ogawa Date: Mon, 12 Mar 2018 14:35:21 +0900 Message-Id: <1520832924-28387-7-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520832924-28387-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <8b08be87-6b64-8a4a-53e0-29269011d81c@lab.ntt.co.jp> <1520832924-28387-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> Subject: [spp] [PATCH 6/9] controller: update Shell for topo_subgraph X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 05:35:41 -0000 From: Yasufumi Ogawa Update do_topo_subgraph() for parsing delimiter. It also update help message. Signed-off-by: Yasufumi Ogawa --- 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