def ui_command_create(self, mapped_lun, tpg_lun_or_backstore, write_protect=None):
    '\n        Creates a mapping to one of the TPG LUNs for the initiator referenced\n        by the ACL. The provided I{tpg_lun_or_backstore} will appear to that\n        initiator as LUN I{mapped_lun}. If the I{write_protect} flag is set to\n        B{1}, the initiator will not have write access to the Mapped LUN.\n\n        A storage object may also be given for the I{tpg_lun_or_backstore} parameter,\n        in which case the TPG LUN will be created for that backstore before\n        mapping the LUN to the initiator. If a TPG LUN for the backstore already\n        exists, the Mapped LUN will map to that TPG LUN.\n\n        SEE ALSO\n        ========\n        B{delete}\n        '
    self.assert_root()
    try:
        mapped_lun = int(mapped_lun)
    except ValueError:
        self.shell.log.error('mapped_lun must be an integer')
        return
    try:
        if tpg_lun_or_backstore.startswith('lun'):
            tpg_lun_or_backstore = tpg_lun_or_backstore[3:]
        tpg_lun = int(tpg_lun_or_backstore)
    except ValueError:
        try:
            so = self.get_node(tpg_lun_or_backstore).rtsnode
        except ValueError:
            self.shell.log.error('LUN or storage object not found')
            return
        ui_tpg = self.parent.parent
        for lun in ui_tpg.rtsnode.luns:
            if (so == lun.storage_object):
                tpg_lun = lun.lun
                break
        else:
            lun_object = LUN(ui_tpg.rtsnode, storage_object=so)
            self.shell.log.info(('Created LUN %s.' % lun_object.lun))
            ui_lun = UILUN(lun_object, ui_tpg.get_node('luns'))
            tpg_lun = ui_lun.rtsnode.lun
    if (tpg_lun in (ml.tpg_lun.lun for ml in self.rtsnodes[0].mapped_luns)):
        self.shell.log.warning(('Warning: TPG LUN %d already mapped to this NodeACL' % tpg_lun))
    for na in self.rtsnodes:
        mlun = MappedLUN(na, mapped_lun, tpg_lun, write_protect)
    ui_mlun = UIMappedLUN(mlun, self)
    self.shell.log.info(('Created Mapped LUN %s.' % mlun.mapped_lun))
    return self.new_node(ui_mlun)
Creates a mapping to one of the TPG LUNs for the initiator referenced
by the ACL. The provided I{tpg_lun_or_backstore} will appear to that
initiator as LUN I{mapped_lun}. If the I{write_protect} flag is set to
B{1}, the initiator will not have write access to the Mapped LUN.

A storage object may also be given for the I{tpg_lun_or_backstore} parameter,
in which case the TPG LUN will be created for that backstore before
mapping the LUN to the initiator. If a TPG LUN for the backstore already
exists, the Mapped LUN will map to that TPG LUN.

SEE ALSO
========
B{delete}
def ui_command_create(self, mapped_lun, tpg_lun_or_backstore, write_protect=None):
    '\n        Creates a mapping to one of the TPG LUNs for the initiator referenced\n        by the ACL. The provided I{tpg_lun_or_backstore} will appear to that\n        initiator as LUN I{mapped_lun}. If the I{write_protect} flag is set to\n        B{1}, the initiator will not have write access to the Mapped LUN.\n\n        A storage object may also be given for the I{tpg_lun_or_backstore} parameter,\n        in which case the TPG LUN will be created for that backstore before\n        mapping the LUN to the initiator. If a TPG LUN for the backstore already\n        exists, the Mapped LUN will map to that TPG LUN.\n\n        SEE ALSO\n        ========\n        B{delete}\n        '
    self.assert_root()
    try:
        mapped_lun = int(mapped_lun)
    except ValueError:
        self.shell.log.error('mapped_lun must be an integer')
        return
    try:
        if tpg_lun_or_backstore.startswith('lun'):
            tpg_lun_or_backstore = tpg_lun_or_backstore[3:]
        tpg_lun = int(tpg_lun_or_backstore)
    except ValueError:
        try:
            so = self.get_node(tpg_lun_or_backstore).rtsnode
        except ValueError:
            self.shell.log.error('LUN or storage object not found')
            return
        ui_tpg = self.parent.parent
        for lun in ui_tpg.rtsnode.luns:
            if (so == lun.storage_object):
                tpg_lun = lun.lun
                break
        else:
            lun_object = LUN(ui_tpg.rtsnode, storage_object=so)
            self.shell.log.info(('Created LUN %s.' % lun_object.lun))
            ui_lun = UILUN(lun_object, ui_tpg.get_node('luns'))
            tpg_lun = ui_lun.rtsnode.lun
    if (tpg_lun in (ml.tpg_lun.lun for ml in self.rtsnodes[0].mapped_luns)):
        self.shell.log.warning(('Warning: TPG LUN %d already mapped to this NodeACL' % tpg_lun))
    for na in self.rtsnodes:
        mlun = MappedLUN(na, mapped_lun, tpg_lun, write_protect)
    ui_mlun = UIMappedLUN(mlun, self)
    self.shell.log.info(('Created Mapped LUN %s.' % mlun.mapped_lun))
    return self.new_node(ui_mlun)