MCPcopy Create free account
hub / github.com/OWASP/Python-Honeypot / remove_old_containers

Function remove_old_containers

core/load.py:153–174  ·  view source on GitHub ↗

remove old containers based on images Args: configuration: user final configuration Returns: True

(configuration)

Source from the content-addressed store, hash-verified

151
152
153def remove_old_containers(configuration):
154 """
155 remove old containers based on images
156
157 Args:
158 configuration: user final configuration
159
160 Returns:
161 True
162 """
163
164 containers_list = all_existing_containers()
165 for container in virtual_machine_names_to_container_names(configuration):
166 if container in containers_list:
167 info(
168 "removing container {0}".format(
169 os.popen(
170 "docker rm {0}".format(container)
171 ).read().rsplit()[0]
172 )
173 )
174 return True
175
176
177def get_image_name_of_selected_modules(configuration):

Callers 2

wait_until_interruptFunction · 0.85
load_honeypot_engineFunction · 0.85

Calls 3

infoFunction · 0.90
all_existing_containersFunction · 0.85

Tested by

no test coverage detected