mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-12 08:06:49 +02:00
Delete an unnecessary function
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 <kakuma@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
46409763d4
commit
742c2a5e20
@ -23,7 +23,6 @@ import logging
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
from docker import Client
|
||||
import netaddr
|
||||
import six
|
||||
|
||||
@ -497,18 +496,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'
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user