swiftly/client/standardclient.py
def auth(self):
        """
        See :py:func:`swiftly.client.client.Client.auth`
        """
        self.reset()
        if not self.auth_url:
            raise ValueError('No Auth URL has been provided.')
        funcs = []
        if self.auth_methods:
            for method in self.auth_methods.split(','):
                funcs.append(getattr(self, '_' + method))
        if not funcs:
            if '1.0' in self.auth_url:
                funcs = [self._auth1, self._auth2key, self._auth2password]
                if not self.auth_tenant:
                    funcs.append(self._auth2password_force_tenant)
            else:
                funcs = [self._auth2key, self._auth2password]
                if not self.auth_tenant:
                    funcs.append(self._auth2password_force_tenant)
                funcs.append(self._auth1)
        info = []
        for func in funcs:
            status, reason = func()
            info.append('%s %s' % (status, reason))
            if status // 100 == 2:
                break
        else:
            raise self.HTTPException('Auth failure %r.' % info)
def auth(self):
        """
        See :py:func:`swiftly.client.client.Client.auth`
        """
        self.reset()
        if not self.auth_url:
            raise ValueError('No Auth URL has been provided.')
        funcs = []
        if self.auth_methods:
            for method in self.auth_methods.split(','):
                funcs.append(getattr(self, '_' + method))
        if not funcs:
            if '1.0' in self.auth_url:
                funcs = [self._auth1, self._auth2key, self._auth2password]
                if not self.auth_tenant:
                    funcs.append(self._auth2password_force_tenant)
            else:
                funcs = [self._auth2key, self._auth2password]
                if not self.auth_tenant:
                    funcs.append(self._auth2password_force_tenant)
                funcs.append(self._auth1)
        info = []
        for func in funcs:
            status, reason = func()
            info.append('%s %s' % (status, reason))
            if status // 100 == 2:
                break
        else:
            raise self.HTTPException('Auth failure %r.' % info)
def auth ( self ) : self . reset ( ) if not self . auth_url : raise ValueError ( 'No Auth URL has been provided.' ) funcs = [ ] if self . auth_methods : for method in self . auth_methods . split ( ',' ) : funcs . append ( getattr ( self , '_' + method ) ) if not funcs : if '1.0' in self . auth_url : funcs = [ self . _auth1 , self . _auth2key , self . _auth2password ] if not self . auth_tenant : funcs . append ( self . _auth2password_force_tenant ) else : funcs = [ self . _auth2key , self . _auth2password ] if not self . auth_tenant : funcs . append ( self . _auth2password_force_tenant ) funcs . append ( self . _auth1 ) info = [ ] for func in funcs : status , reason = func ( ) info . append ( '%s %s' % ( status , reason ) ) if status // 100 == 2 : break else : raise self . HTTPException ( 'Auth failure %r.' % info )
See :py:func:`swiftly.client.client.Client.auth`
See : py : func : swiftly . client . client . Client . auth