add container to this cluster. if this cluster has no id then it's like sync=False.
        :param container: container to add to this cluster
        :param sync: If sync=True(default) synchronize with Ariane server. If sync=False,
        add the container object on list to be added on next save().
        :return:

def add_container(self, container, sync=True):
        """
        add container to this cluster. if this cluster has no id then it's like sync=False.
        :param container: container to add to this cluster
        :param sync: If sync=True(default) synchronize with Ariane server. If sync=False,
        add the container object on list to be added on next save().
        :return:
        """
        LOGGER.debug("Cluster.add_container")
        if not sync or self.id is None:
            self.containers_2_add.append(container)
        else:
            if container.id is None:
                container.save()
            if container.id is not None:
                params = SessionService.complete_transactional_req({
                    'ID': self.id,
                    'containerID': container.id
                })
                if MappingService.driver_type != DriverFactory.DRIVER_REST:
                    params['OPERATION'] = 'addClusterContainer'
                    args = {'properties': params}
                else:
                    args = {'http_operation': 'GET', 'operation_path': 'update/containers/add', 'parameters': params}

                response = ClusterService.requester.call(args)

                if MappingService.driver_type != DriverFactory.DRIVER_REST:
                    response = response.get()

                if response.rc != 0:
                    LOGGER.warning(
                        'Cluster.add_container - Problem while updating cluster ' + self.name +
                        '. Reason: ' + str(response.response_content) + ' - ' + str(response.error_message) +
                        " (" + str(response.rc) + ")"
                    )
                    if response.rc == 500 and ArianeMappingOverloadError.ERROR_MSG in response.error_message:
                        raise ArianeMappingOverloadError("Cluster.add_container", ArianeMappingOverloadError.ERROR_MSG)
                    # traceback.print_stack()
                else:
                    self.containers_id.append(container.id)
                    container.cluster_id = self.id
            else:
                LOGGER.warning(
                    'Cluster.add_container - Problem while updating cluster ' + self.name + '. Reason: container ' +
                    container.gate_uri + ' id is None'
                )