You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@libcloud.apache.org by Patrick Joy <pa...@paddyjoy.com> on 2012/10/16 07:13:34 UTC

Comma followed by space in container name

Hi,

Hope someone can help out. Not sure if this is a bug or by design?

When I try to create a container that has a comma in the name that is 
directly followed by a space, for example "my, container", I get the 
following exception.

Any ideas?

Thanks,
Patrick



16 Oct 2012 16:01:27 : DEBUG    : Container "/tmp/test/my, folder" 
doesn't exist, creating it..
Traceback (most recent call last):
   File "/usr/local/bin/file-syncer", line 5, in <module>
     pkg_resources.run_script('file-syncer==0.2.1', 'file-syncer')
   File 
"/usr/local/lib/python2.7/dist-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", 
line 499, in run_script
     self.require(requires)[0].run_script(script_name, ns)
   File 
"/usr/local/lib/python2.7/dist-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", 
line 1235, in run_script
     execfile(script_filename, namespace, namespace)
   File 
"/usr/local/lib/python2.7/dist-packages/file_syncer-0.2.1-py2.7.egg/EGG-INFO/scripts/file-syncer", 
line 4, in <module>
     run()
   File 
"/usr/local/lib/python2.7/dist-packages/file_syncer-0.2.1-py2.7.egg/file_syncer/run.py", 
line 101, in run
     concurrency=int(options.concurrency))
   File 
"/usr/local/lib/python2.7/dist-packages/file_syncer-0.2.1-py2.7.egg/file_syncer/syncer.py", 
line 72, in __init__
     self._setup_container()
   File 
"/usr/local/lib/python2.7/dist-packages/file_syncer-0.2.1-py2.7.egg/file_syncer/syncer.py", 
line 94, in _setup_container
     container = 
driver.create_container(container_name=self._container_name)
   File 
"/usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/atmos.py", 
line 171, in create_container
     return self.get_container(container_name)
   File 
"/usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/atmos.py", 
line 156, in get_container
     meta = self._emc_meta(result)
   File 
"/usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/atmos.py", 
line 469, in _emc_meta
     return dict([x.split('=', 1) for x in meta])
ValueError: dictionary update sequence element #9 has length 1; 2 is 
required

Re: Comma followed by space in container name

Posted by Patrick Joy <pa...@paddyjoy.com>.
Hi,

Thanks for the reply. It only happens when the container name has ", " 
in it.


Here is a simple example script, cloud-test.py:

from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver
import libcloud.security
import libcloud.storage

print '\nLogging in...'

libcloud.security.VERIFY_SSL_CERT = False
Ninefold = get_driver(Provider.NINEFOLD)
driver = Ninefold('XXXXXX', 'XXXXXX')

print driver.list_containers()

container=driver.create_container("test, container")


Output:


Logging in...
/usr/local/lib/python2.7/dist-packages/libcloud/httplib_ssl.py:57: 
UserWarning: SSL certificate verification is disabled, this can pose a 
security risk. For more information how to enable the SSL certificate 
verification, please visit the libcloud documentation.
warnings.warn(libcloud.security.VERIFY_SSL_DISABLED_MSG)
# -------- begin 23565592 request ----------
curl -i -X GET -H 'Content-Length: 0' -H 'x-emc-signature: 
+m1bBpw/wlytnXLDv+7WS9EQ4KE=' -H 'Accept-Encoding: gzip,deflate' -H 
'X-LC-Request-ID: 23565592' -H 'Accept: */*' -H 'User-Agent: 
libcloud/0.11.3 (Ninefold)' -H 'Host: api.ninefold.com' -H 'Date: Tue, 
16 Oct 2012 08:32:53 GMT' -H 'x-emc-uid: 
c6b5b6a5235d402b8cb4683454c74446/joytech_1350272273013' -H 
'Content-Type: application/octet-stream' -H 'x-emc-date: Tue, 16 Oct 
2012 08:32:53 GMT' --compress 
https://api.ninefold.com:443/storage/v1.0/rest/namespace/
# -------- begin 23565592:23566240 response ----------
HTTP/1.1 200 OK
Content-Length: 325
X-Emc-Useracl: root=FULL_CONTROL
X-Emc-Meta: atime=2012-10-15T03:37:52Z, mtime=2012-10-16T08:32:46Z, 
ctime=2012-10-16T08:32:46Z, itime=2012-10-15T03:37:52Z, type=directory, 
uid=root, gid=root, 
objectid=4d74812eb2a8dd0504d74b72e7f55c0507b8510de536, 
objname=c6b5b6a5235d402b8cb4683454c74446, size=135, nlink=3, 
policyname=default
Connection: close
Server: Apache
X-Emc-Groupacl: other=FULL_CONTROL
Date: Tue, 16 Oct 2012 08:32:54 GMT
Content-Type: text/xml
X-Emc-Policy: _int

<?xml version='1.0' encoding='UTF-8'?>
<ListDirectoryResponse xmlns='http://www.emc.com/cos/'>
<DirectoryList>
<DirectoryEntry>
<ObjectID>4d74812ea9a8dd0504d74b72cf08790507b9dfa8bc21</ObjectID>
<FileType>directory</FileType>
<Filename>apache</Filename>
</DirectoryEntry>
</DirectoryList>
</ListDirectoryResponse>

# -------- end 23565592:23566240 response ----------

[<Container: name=apache, provider=Ninefold>]
# -------- begin 23567536 request ----------
curl -i -X POST -H 'Content-Length: 0' -H 'x-emc-signature: 
TmyPHOUNhacxDhCQynR6lS6bmNk=' -H 'Accept-Encoding: gzip,deflate' -H 
'X-LC-Request-ID: 23567536' -H 'Accept: */*' -H 'User-Agent: 
libcloud/0.11.3 (Ninefold)' -H 'Host: api.ninefold.com' -H 'Date: Tue, 
16 Oct 2012 08:32:54 GMT' -H 'x-emc-uid: 
c6b5b6a5235d402b8cb4683454c74446/joytech_1350272273013' -H 
'Content-Type: application/octet-stream' -H 'x-emc-date: Tue, 16 Oct 
2012 08:32:54 GMT' --compress 
https://api.ninefold.com:443/storage/v1.0/rest/namespace/test%2C%20container/
# -------- begin 23567536:23565592 response ----------
HTTP/1.1 201 Created
Content-Length: 0
Server: Apache
Connection: close
X-Emc-Delta: 0
Location: /rest/objects/4d74812eaca8dd0104d7493d82f56f0507d1bb662d89
Date: Tue, 16 Oct 2012 08:32:54 GMT
Content-Type: text/plain; charset=UTF-8
X-Emc-Policy: _int


# -------- end 23567536:23565592 response ----------

# -------- begin 23568184 request ----------
curl -i -X GET -H 'Content-Length: 0' -H 'x-emc-signature: 
JZYVyrWZhkhJPFITzt/YjrmkcTQ=' -H 'Accept-Encoding: gzip,deflate' -H 
'X-LC-Request-ID: 23568184' -H 'Accept: */*' -H 'User-Agent: 
libcloud/0.11.3 (Ninefold)' -H 'Host: api.ninefold.com' -H 'Date: Tue, 
16 Oct 2012 08:32:54 GMT' -H 'x-emc-uid: 
c6b5b6a5235d402b8cb4683454c74446/joytech_1350272273013' -H 
'Content-Type: application/octet-stream' -H 'x-emc-date: Tue, 16 Oct 
2012 08:32:54 GMT' --compress 
'https://api.ninefold.com:443/storage/v1.0/rest/namespace/test%2C%20container/?metadata/system'
# -------- begin 23568184:23567968 response ----------
HTTP/1.1 200 OK
Content-Length: 0
X-Emc-Meta: atime=2012-10-16T08:32:54Z, mtime=2012-10-16T08:32:54Z, 
ctime=2012-10-16T08:32:54Z, itime=2012-10-16T08:32:54Z, type=directory, 
uid=joytech_1350272273013, gid=apache, 
objectid=4d74812eaca8dd0104d7493d82f56f0507d1bb662d89, objname=test, 
container, size=64, nlink=2, policyname=default
Server: Apache
Connection: close
Date: Tue, 16 Oct 2012 08:32:54 GMT
Content-Type: text/plain; charset=UTF-8
X-Emc-Policy: _int


# -------- end 23568184:23567968 response ----------

Traceback (most recent call last):
File "cloud-test.py", line 14, in <module>
container=driver.create_container("test, container")
File 
"/usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/atmos.py", 
line 171, in create_container
return self.get_container(container_name)
File 
"/usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/atmos.py", 
line 156, in get_container
meta = self._emc_meta(result)
File 
"/usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/atmos.py", 
line 469, in _emc_meta
return dict([x.split('=', 1) for x in meta])
ValueError: dictionary update sequence element #9 has length 1; 2 is 
required


On 16/10/12 18:12, Tomaž Muraus wrote:
> Does this happen every time or only when you try to put comma with a space
> in the name?
>
>  From a quick glance over the error message, it doesn't seem to be related
> to the container name. In any case it would help if you could past your
> whole script here plus the output which you get by running
> LIBCLOUD_DEBUG=/dev/stderr python myscript.py (don't forget to remove your
> credentials).
>
> On Mon, Oct 15, 2012 at 10:13 PM, Patrick Joy <pa...@paddyjoy.com> wrote:
>
>> Hi,
>>
>> Hope someone can help out. Not sure if this is a bug or by design?
>>
>> When I try to create a container that has a comma in the name that is
>> directly followed by a space, for example "my, container", I get the
>> following exception.
>>
>> Any ideas?
>>
>> Thanks,
>> Patrick
>>
>>
>>
>> 16 Oct 2012 16:01:27 : DEBUG    : Container "/tmp/test/my, folder" doesn't
>> exist, creating it..
>> Traceback (most recent call last):
>>    File "/usr/local/bin/file-syncer", line 5, in <module>
>>      pkg_resources.run_script('**file-syncer==0.2.1', 'file-syncer')
>>    File "/usr/local/lib/python2.7/**dist-packages/distribute-0.6.**
>> 24-py2.7.egg/pkg_resources.py"**, line 499, in run_script
>>      self.require(requires)[0].run_**script(script_name, ns)
>>    File "/usr/local/lib/python2.7/**dist-packages/distribute-0.6.**
>> 24-py2.7.egg/pkg_resources.py"**, line 1235, in run_script
>>      execfile(script_filename, namespace, namespace)
>>    File "/usr/local/lib/python2.7/**dist-packages/file_syncer-0.2.**
>> 1-py2.7.egg/EGG-INFO/scripts/**file-syncer", line 4, in <module>
>>      run()
>>    File "/usr/local/lib/python2.7/**dist-packages/file_syncer-0.2.**
>> 1-py2.7.egg/file_syncer/run.**py", line 101, in run
>>      concurrency=int(options.**concurrency))
>>    File "/usr/local/lib/python2.7/**dist-packages/file_syncer-0.2.**
>> 1-py2.7.egg/file_syncer/**syncer.py", line 72, in __init__
>>      self._setup_container()
>>    File "/usr/local/lib/python2.7/**dist-packages/file_syncer-0.2.**
>> 1-py2.7.egg/file_syncer/**syncer.py", line 94, in _setup_container
>>      container = driver.create_container(**container_name=self._**
>> container_name)
>>    File "/usr/local/lib/python2.7/**dist-packages/libcloud/**storage/drivers/atmos.py",
>> line 171, in create_container
>>      return self.get_container(container_**name)
>>    File "/usr/local/lib/python2.7/**dist-packages/libcloud/**storage/drivers/atmos.py",
>> line 156, in get_container
>>      meta = self._emc_meta(result)
>>    File "/usr/local/lib/python2.7/**dist-packages/libcloud/**storage/drivers/atmos.py",
>> line 469, in _emc_meta
>>      return dict([x.split('=', 1) for x in meta])
>> ValueError: dictionary update sequence element #9 has length 1; 2 is
>> required
>>


Re: Comma followed by space in container name

Posted by Tomaž Muraus <to...@apache.org>.
Does this happen every time or only when you try to put comma with a space
in the name?

>From a quick glance over the error message, it doesn't seem to be related
to the container name. In any case it would help if you could past your
whole script here plus the output which you get by running
LIBCLOUD_DEBUG=/dev/stderr python myscript.py (don't forget to remove your
credentials).

On Mon, Oct 15, 2012 at 10:13 PM, Patrick Joy <pa...@paddyjoy.com> wrote:

> Hi,
>
> Hope someone can help out. Not sure if this is a bug or by design?
>
> When I try to create a container that has a comma in the name that is
> directly followed by a space, for example "my, container", I get the
> following exception.
>
> Any ideas?
>
> Thanks,
> Patrick
>
>
>
> 16 Oct 2012 16:01:27 : DEBUG    : Container "/tmp/test/my, folder" doesn't
> exist, creating it..
> Traceback (most recent call last):
>   File "/usr/local/bin/file-syncer", line 5, in <module>
>     pkg_resources.run_script('**file-syncer==0.2.1', 'file-syncer')
>   File "/usr/local/lib/python2.7/**dist-packages/distribute-0.6.**
> 24-py2.7.egg/pkg_resources.py"**, line 499, in run_script
>     self.require(requires)[0].run_**script(script_name, ns)
>   File "/usr/local/lib/python2.7/**dist-packages/distribute-0.6.**
> 24-py2.7.egg/pkg_resources.py"**, line 1235, in run_script
>     execfile(script_filename, namespace, namespace)
>   File "/usr/local/lib/python2.7/**dist-packages/file_syncer-0.2.**
> 1-py2.7.egg/EGG-INFO/scripts/**file-syncer", line 4, in <module>
>     run()
>   File "/usr/local/lib/python2.7/**dist-packages/file_syncer-0.2.**
> 1-py2.7.egg/file_syncer/run.**py", line 101, in run
>     concurrency=int(options.**concurrency))
>   File "/usr/local/lib/python2.7/**dist-packages/file_syncer-0.2.**
> 1-py2.7.egg/file_syncer/**syncer.py", line 72, in __init__
>     self._setup_container()
>   File "/usr/local/lib/python2.7/**dist-packages/file_syncer-0.2.**
> 1-py2.7.egg/file_syncer/**syncer.py", line 94, in _setup_container
>     container = driver.create_container(**container_name=self._**
> container_name)
>   File "/usr/local/lib/python2.7/**dist-packages/libcloud/**storage/drivers/atmos.py",
> line 171, in create_container
>     return self.get_container(container_**name)
>   File "/usr/local/lib/python2.7/**dist-packages/libcloud/**storage/drivers/atmos.py",
> line 156, in get_container
>     meta = self._emc_meta(result)
>   File "/usr/local/lib/python2.7/**dist-packages/libcloud/**storage/drivers/atmos.py",
> line 469, in _emc_meta
>     return dict([x.split('=', 1) for x in meta])
> ValueError: dictionary update sequence element #9 has length 1; 2 is
> required
>