Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: ferruh.yigit@intel.com, geminoa@juno.ocn.ne.jp
Cc: spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 1/3] controller: move import websocket
Date: Mon, 23 Apr 2018 15:22:35 +0900	[thread overview]
Message-ID: <20180423054630.6789-2-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <20180423054630.6789-1-ogawa.yasufumi@lab.ntt.co.jp>
In-Reply-To: <20180423054630.6789-1-ogawa.yasufumi@lab.ntt.co.jp>

From: ogawa.yasufumi@lab.ntt.co.jp

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

To avoid error for a user who does not install websocket, move import
statement from top of the file into to_http method which calls
websocket.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/controller/topo.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/controller/topo.py b/src/controller/topo.py
index 76dd54f..aa81e03 100644
--- a/src/controller/topo.py
+++ b/src/controller/topo.py
@@ -8,7 +8,6 @@ from spp_common import logger
 import subprocess
 import traceback
 import uuid
-import websocket
 import yaml
 
 
@@ -250,6 +249,7 @@ class Topo(object):
         subprocess.call("rm -f %s" % tmpfile, shell=True)
 
     def to_http(self, sec_list):
+        import websocket
         tmpfile = "%s.dot" % uuid.uuid4().hex
         self.to_dot(sec_list, tmpfile)
         msg = open(tmpfile).read()
-- 
2.13.1

  reply	other threads:[~2018-04-23  6:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23  6:22 [spp] [PATCH 0/3] Misc improvements for spp controller ogawa.yasufumi
2018-04-23  6:22 ` ogawa.yasufumi [this message]
2018-04-23  6:22 ` [spp] [PATCH 2/3] controller: add topo_resize command ogawa.yasufumi
2018-04-23  6:22 ` [spp] [PATCH 3/3] docs: add description for " ogawa.yasufumi
2018-05-03 15:58 ` [spp] [PATCH 0/3] Misc improvements for spp controller 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=20180423054630.6789-2-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=geminoa@juno.ocn.ne.jp \
    --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).