Datera / rtslib

The Linux SCSI Target API
http://linux-iscsi.org
Apache License 2.0
19 stars 17 forks source link

bugfix: error when auto-generate IQN based on hostname including '_' #12

Open ls-zhu opened 8 years ago

ls-zhu commented 8 years ago

Hi, This patch can fix a bug : we will see a failure when try to create a IQN automaticly based on host name including "_":

izhu@Leap_Targetcli3:~/workspace/rtslib> hostname Leap_Targetcli3

(1) auto-generate case based on my hostname "LeapTargetcli3" which include a "" /> iscsi/ create Created target iqn.2003-01.org.linux-iscsi.leap-targetcli3.x8664:sn.e7d6f4c4faf6. Selected TPG Tag 1. Created TPG 1.

(2) specify a iqn name includes a "_"

/> iscsi/ create iqn.2016-01.suse.com_aa_bb_cc Created target iqn.2016-01.suse.com-aa-bb-cc. Selected TPG Tag 1. Created TPG 1. />