[spp] [PATCH 5/9] controller: add delimiter for topo command

ogawa.yasufumi at lab.ntt.co.jp ogawa.yasufumi at lab.ntt.co.jp
Mon Mar 12 06:35:20 CET 2018


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

Resource ID consists of resource type and ID separated with
delimiter ':', for instance, 'phy:0'. This delimiter causes a parse
error in topo command because graphviz does not support ':' as a valid
character for node ID. If ':' is included in node ID, graphviz outputs
an imcomplete graph.

To avoid this problem, replace ':' with other valid character for node
IDs while labels displayed in the graph are not replaced.

This update add definitions for charactors of delimiter and label in
'spp_common.py'. Delimiter ':' is replaced with label charactor '_'
while graphviz script is generated.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
---
 src/controller/spp_common.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/controller/spp_common.py b/src/controller/spp_common.py
index 59ba504..b1ab60f 100644
--- a/src/controller/spp_common.py
+++ b/src/controller/spp_common.py
@@ -33,6 +33,9 @@ REMOTE_COMMAND = "RCMD"
 RCMD_EXECUTE_QUEUE = Queue()
 RCMD_RESULT_QUEUE = Queue()
 
+delim_node = '_'
+delim_label = ':'
+
 
 class GrowingList(list):
     """Growing List
-- 
2.7.4



More information about the spp mailing list