Bug 830672

Summary: Please check WWPN with regex before pass to OS /sys check.
Product: Red Hat Enterprise Linux 6 Reporter: Gris Ge <fge>
Component: fcoe-target-utilsAssignee: Andy Grover <agrover>
Status: CLOSED UPSTREAM QA Contact: Storage QE <storage-qe>
Severity: low Docs Contact:
Priority: low    
Version: 6.0   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-11 19:23:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gris Ge 2012-06-11 08:05:36 UTC
Description of problem:

When user enter a incorrect WWPN, it got wired python error dump:

====
/tcm_fc/20:00:00:1b:21:59:12:37/acls/ create  incorrect
====
==========

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/configshell/shell.py", line 990, in run_interactive
    self._cli_loop()
  File "/usr/lib/python2.6/site-packages/configshell/shell.py", line 813, in _cli_loop
    self.run_cmdline(cmdline)
  File "/usr/lib/python2.6/site-packages/configshell/shell.py", line 934, in run_cmdline
    self._execute_command(path, command, pparams, kparams)
  File "/usr/lib/python2.6/site-packages/configshell/shell.py", line 909, in _execute_command
    result = target.execute_command(command, pparams, kparams)
  File "/usr/lib/python2.6/site-packages/targetcli/ui_node.py", line 84, in execute_command
    pparams, kparams)
  File "/usr/lib/python2.6/site-packages/configshell/node.py", line 1405, in execute_command
    result = method(*pparams, **kparams)
  File "/usr/lib/python2.6/site-packages/targetcli/ui_target.py", line 512, in ui_command_create
    node_acl = NodeACL(self.tpg, wwn, mode="create")
  File "/usr/lib/python2.6/site-packages/rtslib/target.py", line 786, in __init__
    self._create_in_cfs_ine(mode)
  File "/usr/lib/python2.6/site-packages/rtslib/node.py", line 65, in _create_in_cfs_ine
    os.mkdir(self.path)
OSError: [Errno 22] Invalid argument: '/sys/kernel/config/target/fc/20:00:00:1b:21:59:12:37/tpgt_1/acls/hel'
==========

Version-Release number of selected component (if applicable):
fcoe-target-utils-2.0rc1.fb10-5.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. Execute:
===
targetcli /tcm_fc/20:00:00:1b:21:59:12:36/acls/ create incorrect
===
2.
3.
  
Actual results:
Python error dump

Expected results:
WWPN format check for any wwpn option.

Additional info:
Requesting exception.
If we want make fcoe-target-utils looks like an enterprise level software rather than homebrew one, we should fix this.

Comment 1 Andy Grover 2012-06-11 19:23:35 UTC
now fixed in upstream python-rtslib