libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LIBCLOUD-914) s3.upload_object_via_stream now returns a generic error
Date Fri, 05 May 2017 11:34:04 GMT

    [ https://issues.apache.org/jira/browse/LIBCLOUD-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15998192#comment-15998192
] 

ASF GitHub Bot commented on LIBCLOUD-914:
-----------------------------------------

GitHub user pquentin opened a pull request:

    https://github.com/apache/libcloud/pull/1055

    [LIBCLOUD-914] Fix raise in s3.upload_object_via_stream

    ## [LIBCLOUD-914] Fix raise in s3.upload_object_via_stream
    
    ### Description
    
    Since libcloud 2.0, s3.upload_object_via_stream as used in Google Storage was raising
a generic
    libcloud.common.types.LibcloudError on all exceptions, but we now raise
    the correct exception. This also removes a comment that is probably
    outdated.
    
    ### Status
    
    - done, ready for review
    
    ### Checklist (tick everything that applies)
    
    - [x] [Code linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
(required, can be done after the PR checks)
    - [x] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/pquentin/libcloud patch-3

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/libcloud/pull/1055.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1055
    
----
commit 8e10044947669491fbd765ba4507e7d4d866f110
Author: Quentin Pradet <quentin@clustree.com>
Date:   2017-05-05T11:21:43Z

    [LIBCLOUD-914] Fix raise in s3.upload_object_via_stream
    
    Since libcloud 2.0, it was raising a generic
    libcloud.common.types.LibcloudError on all exceptions, but we now raise
    the correct exception. This also removes a comment that is probably
    outdated.

----


> s3.upload_object_via_stream now returns a generic error
> -------------------------------------------------------
>
>                 Key: LIBCLOUD-914
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-914
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Storage
>            Reporter: Quentin Pradet
>
> Consider the following snippet:
> {code}
> import io
> from libcloud.storage.base import Container
> from libcloud.storage.drivers.google_storage import GoogleStorageDriver
> driver = GoogleStorageDriver(key='GOOG0123456789ABCXYZ', secret='garbage')
> container = Container(name='container', driver=driver, extra={})
> driver.upload_object_via_stream(io.BytesIO(b' '), container, 'path')
> {code}
> I use wrong credentials on purpose. With libcloud 1.5.0, {{upload_object_via_stream}}
raises libcloud.common.types.InvalidCredsError. With libcloud 2.0.0 and trunk, this returns
the generic {{libcloud.common.types.LibcloudError}} with the message {{'Object upload failed,
Perhaps a timeout?'}}.
> Is it possible to restore the old behavior?
> Thanks for libcloud.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message