Skip to content

Commit bdf77a2

Browse files
committed
[FAB-4829] Error when trying to instantiate
When trying to instantiate chaincode, there is an error. The extra docker images for the chaincode need to be cleaned up at the end of each test run. I've also removed printing the env vars after each run. Change-Id: If5eccf2f1eeb88a7144377b9491871399686d692 Signed-off-by: Latitia M Haskins <[email protected]>
1 parent 4aeb567 commit bdf77a2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/feature/steps/compose_util.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ def issueCommand(self, command, components=[]):
167167
raise Exception(_error)
168168
except:
169169
err = "Error occurred {0}: {1}".format(cmd, sys.exc_info()[1])
170-
#print(err)
171170
output = err
172171

173172
# Don't rebuild if ps command
@@ -204,12 +203,14 @@ def decompose(self):
204203
self.issueCommand(["rm", "-f"])
205204
env = self.getEnv()
206205

207-
print("Current env:", env)
208-
209206
# Now remove associated chaincode containers if any
210207
cmd = ["docker", "ps", "-qa", "--filter", "name={0}".format(self.projectName)]
211208
output = str(subprocess.check_output(cmd, env=env))
212209
container_list = output.strip().split('\n')
213210
for container in container_list:
214211
if container != '':
215212
subprocess.call(['docker', 'rm', '-f', container], env=env)
213+
214+
# Need to remove the chaincode images: docker rmi -f $(docker images | grep "example.com-" | awk '{print $3}')
215+
cmd = ['docker images | grep ".example.com-" | awk \'{print $3}\' | xargs docker rmi']
216+
subprocess.call(cmd, shell=True, env=env)

0 commit comments

Comments
 (0)