lordgamez commented on a change in pull request #1121:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1121#discussion_r702666626
##########
File path: docker/test/integration/minifi/core/ImageStore.py
##########
@@ -0,0 +1,183 @@
+from .NifiContainer import NifiContainer
+from .MinifiContainer import MinifiContainer
+import logging
+import tarfile
+import docker
+from io import BytesIO
+from textwrap import dedent
+import os
+
+
+class ImageStore:
+ def __init__(self):
+ self.client = docker.from_env()
+ self.images = dict()
+
+ def __del__(self):
+ self.cleanup()
+
+ def cleanup(self):
+ # Clean up images
+ for image_id in self.images:
Review comment:
Updated in 009cb33e3536b77098b68616e4ebf0415be7c8e5
##########
File path: docker/test/integration/minifi/core/Container.py
##########
@@ -0,0 +1,47 @@
+import docker
+import logging
+
+
+class Container:
+ def __init__(self, name, engine, vols, network, image_store):
+ self.name = name
+ self.engine = engine
+ self.vols = vols
+ self.network = network
+ self.image_store = image_store
+
+ # Get docker client
+ self.client = docker.from_env()
+ self.deployed = False
+
+ def __del__(self):
+ self.cleanup()
+
+ def cleanup(self):
+ logging.info('Cleaning up container: %s', self.name)
+ try:
+ self.client.containers.get(self.name).remove(v=True, force=True)
+ except docker.errors.NotFound:
+ logging.warn("Container '%s' has been cleaned up already, nothing
to be done.", self.name)
Review comment:
Updated in 009cb33e3536b77098b68616e4ebf0415be7c8e5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]