Currently a scenario test doesn't use stream option of exec_on_ctn and
this function requires extra module(docker-py).
This patch deletes the unnecessary function.

Signed-off-by: Fumihiko Kakuma <[email protected]>
---
 ryu/tests/integrated/common/docker_base.py               | 16 ++++------------
 .../integrated/common/install_docker_test_pkg_common.sh  |  2 +-
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/ryu/tests/integrated/common/docker_base.py 
b/ryu/tests/integrated/common/docker_base.py
index 1cb7cbb..229d943 100644
--- a/ryu/tests/integrated/common/docker_base.py
+++ b/ryu/tests/integrated/common/docker_base.py
@@ -23,7 +23,6 @@ import logging
 import subprocess
 import time
 
-from docker import Client
 import netaddr
 import six
 
@@ -496,18 +495,11 @@ class Container(object):
         else:
             return self.cmd.sudo(cmd, capture=capture)
 
-    def exec_on_ctn(self, cmd, capture=True, stream=False, detach=False):
+    def exec_on_ctn(self, cmd, capture=True, detach=False):
         name = self.docker_name()
-        if stream:
-            # This needs root permission.
-            dcli = Client(timeout=120, version='auto')
-            i = dcli.exec_create(container=name, cmd=cmd)
-            return dcli.exec_start(i['Id'], tty=True,
-                                   stream=stream, detach=detach)
-        else:
-            flag = '-d' if detach else ''
-            return self.dcexec('docker exec {0} {1} {2}'.format(
-                flag, name, cmd), capture=capture)
+        flag = '-d' if detach else ''
+        return self.dcexec('docker exec {0} {1} {2}'.format(
+            flag, name, cmd), capture=capture)
 
     def get_containers(self, allctn=False):
         cmd = 'docker ps --no-trunc=true'
diff --git a/ryu/tests/integrated/common/install_docker_test_pkg_common.sh 
b/ryu/tests/integrated/common/install_docker_test_pkg_common.sh
index 3a54c4c..08b059a 100644
--- a/ryu/tests/integrated/common/install_docker_test_pkg_common.sh
+++ b/ryu/tests/integrated/common/install_docker_test_pkg_common.sh
@@ -33,5 +33,5 @@ function install_depends_pkg {
     sudo rm -rf $DIR_BASE/pipework
     git clone https://github.com/jpetazzo/pipework.git $DIR_BASE/pipework
     sudo install -m 0755 $DIR_BASE/pipework/pipework /usr/local/bin/pipework
-    $SUDO_PIP pip install docker-py pycrypto nsenter
+    $SUDO_PIP pip install pycrypto nsenter
 }
-- 
1.9.1


------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to