def create_container(self, container_name):
        container_name = self._clean_container_name(container_name)
        response = self.connection.request('/%s' % (container_name), method='PUT')

        if response.status == httplib.CREATED:
            # Accepted mean that container is not yet created but it will be
            # eventually
            extra = { 'object_count': 0 }
            container = Container(name=container_name, extra=extra, driver=self)

            return container
        elif response.status == httplib.ACCEPTED:
            error = ContainerAlreadyExistsError(None, self, container_name)
            raise error

        raise LibcloudError('Unexpected status code: %s' % (response.status))
dataset/ETHPy150Open cloudkick/libcloud/libcloud/storage/drivers/cloudfiles.py/CloudFilesStorageDriver.create_container/original