**** CubicPower OpenStack Study ****
def get_iscsi_initiator():
"""Get iscsi initiator name for this machine."""
# NOTE(vish) openiscsi stores initiator name in a file that
# needs root permission to read.
try:
contents = utils.read_file_as_root('/etc/iscsi/initiatorname.iscsi')
except exception.FileNotFound:
return None
for l in contents.split('\n'):
if l.startswith('InitiatorName='):
return l[l.index('=') + 1:].strip()