targetcli causes calltrace with the particular partition names which include 2 digits.
Issue
-
targetcli causes calltrace with the particular partition names which include 2 digits.
For example, create block device with sda10 and run 'ls' in targetcli.utils.py:90:fread:IOError: [Errno 2] No such file or directory: '/sys/block/sda1/sda10/size' Traceback (most recent call last): File "/bin/targetcli", line 121, in <module> main() File "/bin/targetcli", line 111, in main shell.run_interactive() File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 894, in run_interactive self._cli_loop() File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 723, in _cli_loop self.run_cmdline(cmdline) File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 837, in run_cmdline self._execute_command(path, command, pparams, kparams) File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 812, in _execute_command result = target.execute_command(command, pparams, kparams) File "/usr/lib/python2.7/site-packages/configshell_fb/node.py", line 1411, in execute_command return method(*pparams, **kparams) File "/usr/lib/python2.7/site-packages/configshell_fb/node.py", line 710, in ui_command_ls tree = self._render_tree(target, depth=depth) File "/usr/lib/python2.7/site-packages/configshell_fb/node.py", line 861, in _render_tree + self._render_tree(children[i], margin, depth) File "/usr/lib/python2.7/site-packages/configshell_fb/node.py", line 765, in _render_tree (description, is_healthy) = root.summary() File "/usr/lib/python2.7/site-packages/targetcli/ui_backstore.py", line 540, in summary return ("%s (%s) %s%s %s" % (so.udev_path, bytes_to_human(so.size), File "/usr/lib/python2.7/site-packages/rtslib_fb/tcm.py", line 703, in _get_size return get_size_for_disk_name(self._parse_info('device')) * int(self._parse_info('SectorSize')) File "/usr/lib/python2.7/site-packages/rtslib_fb/utils.py", line 162, in get_size_for_disk_name return get_size("/sys/block/%s/%s" % (disk, m.group()), True) File "/usr/lib/python2.7/site-packages/rtslib_fb/utils.py", line 141, in get_size sect_size = int(fread("%s/size" % path)) File "/usr/lib/python2.7/site-packages/rtslib_fb/utils.py", line 90, in fread with open(path, 'r') as file_fd: IOError: [Errno 2] No such file or directory: '/sys/block/sda1/sda10/size' Local variables in innermost frame: path: '/sys/block/sda1/sda10/size'
Environment
- Red Hat Enterprise Linux 7
- targetcli
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
