Fix multiple rename case

This change fixes an issue where multiple renames to the same name
will be attempted, but will fail because the first rename took the
unique name.

Change-Id: Iee8be13e0e6450e3924aa12b02de3cfa702ee8a2
This commit is contained in:
Steve Baker
2017-05-09 09:31:32 +12:00
parent e4cf82b9cf
commit 491358ce11

View File

@@ -108,7 +108,9 @@ class DockerRunner(object):
LOG.info('Cannot rename "%s" since "%s" still exists' % (
current, desired))
else:
LOG.info('Renaming "%s" to "%s"' % (current, desired))
self.rename_container(current, desired)
current_containers.append(desired)
def rename_container(self, container, name):
cmd = [self.docker_cmd, 'rename', container, name]