CORD-2748 core no longer needs to restart TOSCA engine
Change-Id: I4fe1369587f6094661312feebe672b9f39175a6e
diff --git a/containers/xos/pip_requirements.txt b/containers/xos/pip_requirements.txt
index 8032632..4e65d35 100644
--- a/containers/xos/pip_requirements.txt
+++ b/containers/xos/pip_requirements.txt
@@ -38,10 +38,8 @@
djangorestframework==3.7.7
dnslib==0.9.6
docutils==0.13.1
-docker-compose==1.9.0
docker-py==1.10.6
docker_pycreds==0.2.1
-dockerpty==0.4.1
docopt==0.6.2
dogpile.cache==0.6.2
enum34==1.1.6
diff --git a/xos/coreapi/core_main.py b/xos/coreapi/core_main.py
index 2138e75..2de425a 100644
--- a/xos/coreapi/core_main.py
+++ b/xos/coreapi/core_main.py
@@ -19,7 +19,7 @@
import sys
import time
-from grpc_server import XOSGrpcServer, restart_related_containers
+from grpc_server import XOSGrpcServer
from xosconfig import Config
from multistructlog import create_logger
@@ -63,8 +63,6 @@
log.warning("Skipping reaper as django is not initialized")
reaper = None
- restart_related_containers()
-
log.info("XOS core entering wait loop")
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
try:
diff --git a/xos/coreapi/grpc_server.py b/xos/coreapi/grpc_server.py
index 6966934..64dea89 100644
--- a/xos/coreapi/grpc_server.py
+++ b/xos/coreapi/grpc_server.py
@@ -197,29 +197,6 @@
self.delayed_shutdown_timer = threading.Timer(seconds, self.stop_and_exit)
self.delayed_shutdown_timer.start()
-def restart_docker_container(name):
- import docker
-
- def find_container(client, search_name):
- for c in client.containers():
- for c_name in c["Names"]:
- if (search_name in c_name):
- return c
- return None
-
- client=docker.from_env()
- container = find_container(client, name)
- if container:
- try:
- # the first attempt always fails with 404 error
- # docker-py bug?
- client.restart(container["Names"][0])
- except:
- client.restart(container["Names"][0])
-
-def restart_related_containers():
- # TODO: remove once Tosca container is able to react internally
- restart_docker_container("xos_tosca_1")