You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by "Tomaz Muraus (JIRA)" <ji...@apache.org> on 2013/09/05 12:32:56 UTC

[jira] [Updated] (LIBCLOUD-328) Creating a container with an '@', then creating object inside container encodes url twice

     [ https://issues.apache.org/jira/browse/LIBCLOUD-328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tomaz Muraus updated LIBCLOUD-328:
----------------------------------

    Fix Version/s: 0.13.0
    
> Creating a container with an '@', then creating object inside container encodes url twice
> -----------------------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-328
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-328
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Storage
>    Affects Versions: 0.12.3
>         Environment: testing with cloudfiles
>            Reporter: David Bryson
>            Assignee: Tomaz Muraus
>            Priority: Minor
>             Fix For: 0.13.0
>
>
> Using sample code from documentation:
> {code}
> container_name = 'david@statichacks.org'
> # Create a container if it doesn't already exist
> try:
>     container = driver.get_container(container_name=container_name)
>     print "Using existing container %s" % container_name
> except ContainerDoesNotExistError:
>     container = driver.create_container(container_name=container_name)
>     print "Created new container %s" % container_name
> print 'Uploading object...'
> content = { 'content_type' : 'audio' }
> # Compress data in our directory and stream it directly to CF
> obj = container.upload_object(file_name, object_name=object_name,
>                 extra=content)
> {code}
> Produces a double encoded URL for the upload_object call:
> {noformat}
> URL: david%40statichacks.org
> Created new container david@statichacks.org
> Uploading object...
> URL: david%2540statichacks.org
> {'bytes_transferred': 4269,
>  'data_hash': 'eb80d68c737781db10b748fd53ecdd22',
>  'response': <libcloud.storage.drivers.cloudfiles.CloudFilesRawResponse object at 0x25d1310>}
> 404
> {'date': 'Wed, 22 May 2013 15:06:58 GMT', 'content-length': '70', 'content-type': 'text/html; charset=UTF-8', 'x-trans-id': 'txa6557bd13bb14d1895154d4b36049a55'}
> {noformat}
> I can avoid this by overwriting the container object in the above code with another 'get_container' call.  But it seems like the code should just do the right thing when an object uploaded using an existing container.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira