Description of problem: When using a block partition that is non-standard such as NVME device, targetcli fails to locate the sysfs size file. Version-Release number of selected component (if applicable): targetcli-2.1.fb26-1.fc19.noarch How reproducible: Steps to Reproduce: 1. run targetcli 2. cd /backstores/block 3. create nvme0 /dev/nvme0n1p5 4. ls Actual results: /backstores/block> create nvme0 /dev/nvme0n1p5 Created block storage object nvme0 using /dev/nvme0n1p5. /backstores/block> ls Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/configshell/shell.py", line 990, in run_interactive self._cli_loop() File "/usr/lib/python2.7/site-packages/configshell/shell.py", line 813, in _cli_loop self.run_cmdline(cmdline) File "/usr/lib/python2.7/site-packages/configshell/shell.py", line 934, in run_cmdline self._execute_command(path, command, pparams, kparams) File "/usr/lib/python2.7/site-packages/configshell/shell.py", line 909, in _execute_command result = target.execute_command(command, pparams, kparams) File "/usr/lib/python2.7/site-packages/targetcli/ui_node.py", line 87, in execute_command pparams, kparams) File "/usr/lib/python2.7/site-packages/configshell/node.py", line 1417, in execute_command result = method(*pparams, **kparams) File "/usr/lib/python2.7/site-packages/configshell/node.py", line 714, in ui_command_ls tree = self._render_tree(target, depth=depth) File "/usr/lib/python2.7/site-packages/configshell/node.py", line 865, in _render_tree + self._render_tree(children[i], margin, depth) File "/usr/lib/python2.7/site-packages/configshell/node.py", line 769, in _render_tree (description, is_healthy) = root.summary() File "/usr/lib/python2.7/site-packages/targetcli/ui_backstore.py", line 423, in summary return ("%s (%s) %s%s %s" % (so.udev_path, bytes_to_human(so.size), File "/usr/lib/python2.7/site-packages/rtslib/tcm.py", line 707, in _get_size return get_blockdev_size(self._parse_info('device')) * int(self._parse_info('SectorSize')) File "/usr/lib/python2.7/site-packages/rtslib/utils.py", line 124, in get_blockdev_size return int(fread("/sys/block/%s/%s/size" % (m.groups()[0], m.group()))) File "/usr/lib/python2.7/site-packages/rtslib/utils.py", line 88, in fread with open(path, 'r') as file_fd: IOError: [Errno 2] No such file or directory: '/sys/block/p/p5/size' Expected results: /backstores/block> ls o- block ................................................. [Storage Objects: 1] o- nvme0 ...................... [/dev/nvme0n1p5 (2.0GiB) write-thru activated] Additional info: Essentially in /usr/lib/python2.7/site-packages/rtslib/utils.py:122 where it does the regular expression search match it is not able to handle anything besides generic block devices such as /dev/sdN and /dev/hdN. A non typical block device naming such as NVME breaks that search pattern. It should end up reading: /sys/block/nvme0n1/nvme0n1p5/size and not /sys/block/p/p5/size.
python-rtslib-2.1.fb38-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/python-rtslib-2.1.fb38-1.fc19
python-rtslib-2.1.fb38-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/python-rtslib-2.1.fb38-1.fc20
python-rtslib-2.1.fb38-1.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/python-rtslib-2.1.fb38-1.fc18
Package python-rtslib-2.1.fb38-1.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing python-rtslib-2.1.fb38-1.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-16355/python-rtslib-2.1.fb38-1.fc18 then log in and leave karma (feedback).
I tested and it's fixed. Thanks!
python-rtslib-2.1.fb39-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/python-rtslib-2.1.fb39-1.fc19
python-rtslib-2.1.fb39-1.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/python-rtslib-2.1.fb39-1.fc18
python-rtslib-2.1.fb39-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/python-rtslib-2.1.fb39-1.fc20
python-rtslib-2.1.fb40-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/python-rtslib-2.1.fb40-1.fc19
python-rtslib-2.1.fb40-1.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/python-rtslib-2.1.fb40-1.fc18
python-rtslib-2.1.fb40-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/python-rtslib-2.1.fb40-1.fc20
python-rtslib-2.1.fb40-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
python-rtslib-2.1.fb40-1.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.
python-rtslib-2.1.fb40-1.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.