'Set the initiatorgroup property of a LUN.'

def set_lun_initiatorgroup(self, pool, project, lun, initiatorgroup):

    if (len(initiatorgroup) == 0):
        initiatorgroup = 'com.sun.ms.vss.hg.maskAll'
    elif (len(initiatorgroup) == 1):
        initiatorgroup = initiatorgroup[0]
    svc = ((((('/api/storage/v1/pools/' + pool) + '/projects/') + project) + '/luns/') + lun)
    arg = {'initiatorgroup': initiatorgroup}
    LOG.debug('Setting    LUN    initiatorgroup.    pool=%(pool)s,    project=%(project)s,    lun=%(lun)s,    initiatorgroup=%(initiatorgroup)s', {'project': project, 'pool': pool, 'lun': lun, 'initiatorgroup': initiatorgroup})
    ret = self.rclient.put(svc, arg)
    if (ret.status != restclient.Status.ACCEPTED):
        LOG.error('Error    Setting    Volume:    %(lun)s    to    InitiatorGroup:    %(initiatorgroup)s    Pool:    %(pool)s    Project:    %(project)s        Return    code:    %(ret.status)d    Message:    %(ret.data)s.', {'lun': lun, 'initiatorgroup': initiatorgroup, 'pool': pool, 'project': project, 'ret.status': ret.status, 'ret.data': ret.data})
