def modifying_docker_compose_file(self):
    if ((not self.docker_compose_file) or (not os.path.exists(self.docker_compose_file))):
        raise Exception(('Missing docker compose file [%s]' % str(self.docker_compose_file)))
    with open(self.docker_compose_file, 'r') as f:
        cleansed_content = self.replace_environment_value(yaml.load(f))
        named_containers = self.name_containers(cleansed_content)
    if named_containers:
        with open(self.docker_compose_file, 'w') as f:
            f.write(yaml.dump(named_containers))
def modifying_docker_compose_file(self):
    if ((not self.docker_compose_file) or (not os.path.exists(self.docker_compose_file))):
        raise Exception(('Missing docker compose file [%s]' % str(self.docker_compose_file)))
    with open(self.docker_compose_file, 'r') as f:
        cleansed_content = self.replace_environment_value(yaml.load(f))
        named_containers = self.name_containers(cleansed_content)
    if named_containers:
        with open(self.docker_compose_file, 'w') as f:
            f.write(yaml.dump(named_containers))