You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/08/02 08:40:37 UTC
[GitHub] [nifi-minifi-cpp] lordgamez commented on a change in pull request #1121: MINIFICPP-1596 Refactor docker tests by removing unnecessary clusters
lordgamez commented on a change in pull request #1121:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1121#discussion_r680783600
##########
File path: docker/test/integration/minifi/core/Container.py
##########
@@ -0,0 +1,102 @@
+import docker
+import logging
+import tarfile
+from io import BytesIO
+
+
+class Container:
+ def __init__(self, name, engine, vols, network):
+ self.name = name
+ self.engine = engine
+ self.vols = vols
+ self.network = network
+
+ # Get docker client
+ self.client = docker.from_env()
+ self.image = None
+ 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:
Review comment:
It shouldn't cause any problems if there is this happens, but I added a warning to see if there is a duplicate cleanup in 489cbf0e0a080478182ba51fe7235c18536e79cb
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org