'Create a share in the specified pool and project'

def create_share(self, pool, project, share, args):

    svc = (self.share_path % (pool, project, share))
    ret = self.rclient.get(svc)
    if (ret.status != restclient.Status.OK):
        svc = (self.shares_path % (pool, project))
        args.update({'name': share})
        ret = self.rclient.post(svc, args)
        if (ret.status != restclient.Status.CREATED):
            exception_msg = (_('Error    Creating    Share:    %(name)s    Return    code:    %(ret.status)d    Message:    %(ret.data)s.') % {'name': share, 'ret.status': ret.status, 'ret.data': ret.data})
            LOG.error(exception_msg)
            raise exception.VolumeBackendAPIException(data=exception_msg)
    else:
        LOG.debug('Editing    properties    of    a    pre-existing    share')
        ret = self.rclient.put(svc, args)
        if (ret.status != restclient.Status.ACCEPTED):
            exception_msg = (_('Error    editing    share:    %(share)s    on    Pool:    %(pool)s    Return    code:    %(ret.status)d    Message:    %(ret.data)s    .') % {'share': share, 'pool': pool, 'ret.status': ret.status, 'ret.data': ret.data})
            LOG.error(exception_msg)
            raise exception.VolumeBackendAPIException(data=exception_msg)
