Discussion:
[Libstoragemgmt-devel] [BUG] Curernt python API does not allow "volume_create(pool=pool, ...)" calling way.
Gris Ge
2014-04-20 11:21:15 UTC
Permalink
Hi Guys,

I just found this script will fail:
====
#!/usr/bin/python2
import lsm
cli=lsm.Client('sim://')
pools =cli.pools()
cli.volume_create(
pool=pools[0], volume_name='abc', size_bytes=1024, provisioning=1,
flags=0)
====

with error:
====
Traceback (most recent call last):
File "test.py", line 7, in <module>
flags=0)
TypeError: inner() got an unexpected keyword argument 'pool'
====

It seems a bug at lsm/_common.py:
Proxy:_present()

Anyone have quick fix?

Thanks.
--
Gris Ge
MaShimiao
2014-04-21 06:52:10 UTC
Permalink
Hi Gris,
Post by Gris Ge
Hi Guys,
====
#!/usr/bin/python2
import lsm
cli=lsm.Client('sim://')
pools =cli.pools()
cli.volume_create(
pool=pools[0], volume_name='abc', size_bytes=1024, provisioning=1,
flags=0)
====
====
File "test.py", line 7, in <module>
flags=0)
TypeError: inner() got an unexpected keyword argument 'pool'
====
Proxy:_present()
Anyone have quick fix?
I think the bug is not at _present().
It should be at inner().
We should change inner() from inner(*args) to inner(*args, **kwargs).
I will send patch to fix this bug.
Post by Gris Ge
Thanks.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Libstoragemgmt-devel mailing list
https://lists.sourceforge.net/lists/listinfo/libstoragemgmt-devel
--
Ma Shimiao
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
Loading...