Skip to content

Commit

Permalink
[FAB-4829] Error when trying to instantiate
Browse files Browse the repository at this point in the history
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 <latitia.haskins@gmail.com>
  • Loading branch information
lhaskins committed Jun 23, 2017
1 parent 4aeb567 commit bdf77a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/feature/steps/compose_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def issueCommand(self, command, components=[]):
raise Exception(_error)
except:
err = "Error occurred {0}: {1}".format(cmd, sys.exc_info()[1])
#print(err)
output = err

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

print("Current env:", env)

# Now remove associated chaincode containers if any
cmd = ["docker", "ps", "-qa", "--filter", "name={0}".format(self.projectName)]
output = str(subprocess.check_output(cmd, env=env))
container_list = output.strip().split('\n')
for container in container_list:
if container != '':
subprocess.call(['docker', 'rm', '-f', container], env=env)

# Need to remove the chaincode images: docker rmi -f $(docker images | grep "example.com-" | awk '{print $3}')
cmd = ['docker images | grep ".example.com-" | awk \'{print $3}\' | xargs docker rmi']
subprocess.call(cmd, shell=True, env=env)

0 comments on commit bdf77a2

Please sign in to comment.