(self, resp, **kwargs)
Response callback to save credentials on success.
Response callback to save credentials on success.
Response callback to save credentials on success .
def save_credentials(self, resp, **kwargs):
        """Response callback to save credentials on success."""
        assert keyring is not None, "should never reach here without keyring"
        if not keyring:
            return

        creds = self._credentials_to_save
        self._credentials_to_save = None
        if creds and resp.status_code < 400:
            try:
                logger.info('Saving credentials to keyring')
                keyring.set_password(*creds)
            except Exception:
                logger.exception('Failed to save credentials')
def save_credentials ( self , resp , * * kwargs ) : assert keyring is not None , "should never reach here without keyring" if not keyring : return creds = self . _credentials_to_save self . _credentials_to_save = None if creds and resp . status_code < 400 : try : logger . info ( 'Saving credentials to keyring' ) keyring . set_password ( * creds ) except Exception : logger . exception ( 'Failed to save credentials' )