Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rtslib/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,7 @@ def __init__(self, fabric_module, wwn=None, mode='any'):

if wwn is not None:
wwn = str(wwn).strip()
wwn = wwn.replace("_","-")
elif fabric_module.spec['wwn_list']:
existing_wwns = set([child.wwn for child in fabric_module.targets])
free_wwns = fabric_module.spec['wwn_list'] - existing_wwns
Expand Down
3 changes: 2 additions & 1 deletion rtslib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,8 @@ def generate_wwn(wwn_type):
if wwn_type == 'unit_serial':
return str(uuid.uuid4())
elif wwn_type == 'iqn':
localname = socket.gethostname().split(".")[0]
localname_raw = socket.gethostname().split(".")[0]
localname = localname_raw.replace("_","-")
localarch = os.uname()[4].replace("_","")
prefix = "iqn.2003-01.org.linux-iscsi.%s.%s" % (localname, localarch)
prefix = prefix.strip().lower()
Expand Down