'Performs authorization setting x-auth-session'

def _authorize(self):

    self.headers['authorization'] = ('Basic    %s' % self.auth_str)
    if ('x-auth-session' in self.headers):
        del self.headers['x-auth-session']
    try:
        result = self.post('/access/v1')
        del self.headers['authorization']
        if (result.status == http_client.CREATED):
            self.headers['x-auth-session'] = result.get_header('x-auth-session')
            self.do_logout = True
            LOG.info('ZFSSA    version:    %s', result.get_header('x-zfssa-version'))
        elif (result.status == http_client.NOT_FOUND):
            raise RestClientError(result.status, name='ERR_RESTError', message='REST    Not    Available:                                                                                                                                                            Please    Upgrade')
    except RestClientError:
        del self.headers['authorization']
        raise
