Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
targetcli-fb seems broken
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
JuNix
Apprentice
Apprentice


Joined: 05 Mar 2003
Posts: 224
Location: Sheffield

PostPosted: Thu May 21, 2020 3:19 pm    Post subject: targetcli-fb seems broken Reply with quote

After the recent python update, it seems targetcli-fb is broken.

Code:
filer ~ # targetcli
targetcli shell version 2.1.51
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

/> restoreconfig
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.7/targetcli", line 272, in <module>
    main()
  File "/usr/lib/python-exec/python3.7/targetcli", line 260, in main
    shell.run_interactive()
  File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 905, in run_interactive
    self._cli_loop()
  File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 734, in _cli_loop
    self.run_cmdline(cmdline)
  File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 848, in run_cmdline
    self._execute_command(path, command, pparams, kparams)
  File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 823, in _execute_command
    result = target.execute_command(command, pparams, kparams)
  File "/usr/lib/python3.7/site-packages/configshell_fb/node.py", line 1406, in execute_command
    return method(*pparams, **kparams)
  File "/usr/lib/python3.7/site-packages/targetcli/ui_root.py", line 192, in ui_command_restoreconfig
    target, storage_object)
TypeError: restore_from_file() takes from 1 to 4 positional arguments but 5 were given


Code:
filer ~ # eix targetcli
[I] sys-block/targetcli-fb
     Available versions:  2.1.49 2.1.51 {PYTHON_TARGETS="python3_6 python3_7"}
     Installed versions:  2.1.51(16:07:29 21/05/20)(PYTHON_TARGETS="python3_7 -python3_6")
     Homepage:            https://github.com/open-iscsi/targetcli-fb
     Description:         Command shell for managing Linux LIO kernel target

filer ~ # eix configshell
[I] dev-python/configshell-fb
     Available versions:  1.1.25 ~1.1.27 {PYTHON_TARGETS="python3_6 python3_7 python3_8"}
     Installed versions:  1.1.25(16:07:14 21/05/20)(PYTHON_TARGETS="python3_7 -python3_6")
     Homepage:            https://github.com/open-iscsi/configshell-fb
     Description:         A Python library for building configuration shells

filer ~ # eix rtslib
[I] dev-python/rtslib-fb
     Available versions:  2.1.69 {PYTHON_TARGETS="python3_6 python3_7"}
     Installed versions:  2.1.69(16:07:21 21/05/20)(PYTHON_TARGETS="python3_7 -python3_6")
     Homepage:            https://github.com/open-iscsi/rtslib-fb
     Description:         A Python object API for managing the Linux LIO kernel target


Code:
filer ~ # grep restore_from_file /usr/lib/python3.7/site-packages/rtslib_fb/*.py
/usr/lib/python3.7/site-packages/rtslib_fb/root.py:    def restore_from_file(self, restore_file=None, clear_existing=True, abort_on_error=False):

filer ~ # grep -A1 restore_from_file /usr/lib/python3.7/site-packages/targetcli/*.py
/usr/lib/python3.7/site-packages/targetcli/ui_root.py:        errors = self.rtsroot.restore_from_file(savefile, clear_existing,
/usr/lib/python3.7/site-packages/targetcli/ui_root.py-                                                target, storage_object)


Seems like a mismatch of targetcli-fb and rtslib version to me. One sends certain arguments to restore_from_file(), but restore_from_file() expects different args.
Hopefully the maintainer can advise or resolve it... otherwise I'll grab it from git and manually install it from outside of portage !

Thanks!
Back to top
View user's profile Send private message
JuNix
Apprentice
Apprentice


Joined: 05 Mar 2003
Posts: 224
Location: Sheffield

PostPosted: Thu May 21, 2020 3:43 pm    Post subject: Reply with quote

Actually
Code:
targetctl restore
still works fine. Really odd!
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22593

PostPosted: Fri May 22, 2020 1:38 am    Post subject: Re: targetcli-fb seems broken Reply with quote

A Python script can contain statements that are guaranteed to fail when run, and yet it is not an error until the statement is run. Some invocations of the tool may not execute the faulty statement, in which case they can work normally.
JuNix wrote:
After the recent python update, it seems targetcli-fb is broken.
An update of the system package dev-lang/python, or an update of a Python package, possibly performed as a side effect of switching Python versions?
JuNix wrote:
Seems like a mismatch of targetcli-fb and rtslib version to me. One sends certain arguments to restore_from_file(), but restore_from_file() expects different args.
That seems plausible.
JuNix wrote:
Hopefully the maintainer can advise or resolve it...
The maintainer may not read your forum post. If you want attention from the Gentoo maintainer, you should report a bug.
JuNix wrote:
otherwise I'll grab it from git and manually install it from outside of portage !
Why would you do that? Do not bypass the package manager. That will cause you problems later. Fix the package in Portage.
Back to top
View user's profile Send private message
JuNix
Apprentice
Apprentice


Joined: 05 Mar 2003
Posts: 224
Location: Sheffield

PostPosted: Fri May 22, 2020 10:51 am    Post subject: Reply with quote

Thanks. I didn't think to look in the Bug Tracker. Looks like there is already a BUG
open for this issue.

and a Pull Request to get the required version of rtslib-fb into the tree

Thanks!
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3916

PostPosted: Fri May 22, 2020 11:13 am    Post subject: Reply with quote

If you are using systemd then you can enable target service
Code:

systemctl enable target

This way the config persists across boots.
However I dont see any target service for openrc in /etc/init.d.
Just "iscsid" which I think is for the initiator.
:)
Back to top
View user's profile Send private message
JuNix
Apprentice
Apprentice


Joined: 05 Mar 2003
Posts: 224
Location: Sheffield

PostPosted: Fri May 22, 2020 11:15 am    Post subject: Reply with quote

I don't use systemd.

I have a kind of hacky way to do it on my Gentoo-based NAS.....

Code:
filer ~ # cat /etc/local.d/01targetcli.start
#!/bin/bash

targetctl restore
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum