Re: Issue with Targetcli -- Python error - F20
by Christophe Vu-Brugier
Hi,
On Thu, 19 Jun 2014 17:12:51 -0400, deeepdish wrote :
> I'm trying to create a block backstore in targetcli on a newly
> installed Fedora 20 system.
>
> I can confirm this is working on another Fedora 20 system (installed
> about a month ago), and am wondering if there's an update somewhere
> that may be impacting targetcli.
>
> Here's what I'm attempting:
>
> [root@bl05ssn09 ~]# lvcreate -n TEST -L 1G data
> Logical volume "TEST" created
> [root@bl05ssn09 ~]# targetcli
> targetcli shell version 2.1.fb35
> Copyright 2011-2013 by Datera, Inc and others.
> For help on commands, type 'help'.
>
> /backstores/block> create name=test dev=/dev/data/TEST
> Traceback (most recent call last):
> File "/usr/bin/targetcli", line 100, in <module>
> main()
> File "/usr/bin/targetcli", line 90, in main
> shell.run_interactive()
> File "/usr/lib/python2.7/site-packages/configshell/shell.py", line
> 948, in run_interactive
> self._cli_loop()
> File "/usr/lib/python2.7/site-packages/configshell/shell.py", line
> 777, in _cli_loop
> self.run_cmdline(cmdline)
> File "/usr/lib/python2.7/site-packages/configshell/shell.py", line
> 891, in run_cmdline
> self._execute_command(path, command, pparams, kparams)
> File "/usr/lib/python2.7/site-packages/configshell/shell.py", line
> 866, in _execute_command
> result = target.execute_command(command, pparams, kparams)
> File "/usr/lib/python2.7/site-packages/configshell/node.py", line
> 1413, in execute_command
> return method(*pparams, **kparams)
> File "/usr/lib/python2.7/site-packages/targetcli/ui_backstore.py",
> line 387, in ui_command_create
> so = BlockStorageObject(name, dev, readonly=readonly,
> write_back=write_back)
> File "/usr/lib/python2.7/site-packages/rtslib/tcm.py", line 677, in
> __init__ raise
> TypeError: exceptions must be old-style classes or derived from
> BaseException, not NoneType
>
> [root@bl05ssn09 ~]# targetcli /backstores/block create name=test
> dev=/dev/data/TEST
> exceptions must be old-style classes or derived from BaseException,
> not NoneType
> [root@bl05ssn09 ~]#
I managed to reproduce your bug on a Fedora 20 with a 3.14 kernel
(3.14.6-200.fc20.x86_64). The exception happens in the following part
of tcm.py:
At line 694 in BlockStorageObject._configure():
if write_back:
self.set_attribute("emulate_write_cache", 1)
The set_attribute() method fails because of a permission denied error.
As a workaround, you can comment out the two instructions in the
following file :
/usr/lib/python2.7/site-packages/rtslib/tcm.py
Best regards,
--
Christophe Vu-Brugier
9 years, 10 months
Re: Issue with Targetcli -- Python error - F20
by Andy Grover
On 06/19/2014 02:12 PM, deeepdish wrote:
> I'm trying to create a block backstore in targetcli on a newly installed
> Fedora 20 system.
>
> I can confirm this is working on another Fedora 20 system (installed
> about a month ago), and am wondering if there's an update somewhere that
> may be impacting targetcli.
>
> Here's what I'm attempting:
>
> [root@bl05ssn09 ~]# lvcreate -n TEST -L 1G data
> Logical volume "TEST" created
> [root@bl05ssn09 ~]# targetcli
> targetcli shell version 2.1.fb35
> Copyright 2011-2013 by Datera, Inc and others.
> For help on commands, type 'help'.
>
> /backstores/block> create name=test dev=/dev/data/TEST
> Traceback (most recent call last):
> File "/usr/bin/targetcli", line 100, in <module>
> main()
> File "/usr/bin/targetcli", line 90, in main
> shell.run_interactive()
> File "/usr/lib/python2.7/site-packages/configshell/shell.py", line
> 948, in run_interactive
> self._cli_loop()
> File "/usr/lib/python2.7/site-packages/configshell/shell.py", line
> 777, in _cli_loop
> self.run_cmdline(cmdline)
> File "/usr/lib/python2.7/site-packages/configshell/shell.py", line
> 891, in run_cmdline
> self._execute_command(path, command, pparams, kparams)
> File "/usr/lib/python2.7/site-packages/configshell/shell.py", line
> 866, in _execute_command
> result = target.execute_command(command, pparams, kparams)
> File "/usr/lib/python2.7/site-packages/configshell/node.py", line
> 1413, in execute_command
> return method(*pparams, **kparams)
> File "/usr/lib/python2.7/site-packages/targetcli/ui_backstore.py",
> line 387, in ui_command_create
> so = BlockStorageObject(name, dev, readonly=readonly,
> write_back=write_back)
> File "/usr/lib/python2.7/site-packages/rtslib/tcm.py", line 677, in
> __init__
> raise
> TypeError: exceptions must be old-style classes or derived from
> BaseException, not NoneType
>
> [root@bl05ssn09 ~]# targetcli /backstores/block create name=test
> dev=/dev/data/TEST
> exceptions must be old-style classes or derived from BaseException, not
> NoneType
> [root@bl05ssn09 ~]#
That is very weird. I'll try to reproduce. Any idea what might be
different on the system where it works, and the one having this problem?
Thanks -- Andy
9 years, 10 months