confidant_client/__init__.py
def revert_credential(
            self,
            id,
            revision=None
            ):
        """Reverts a credential to a previous revision.

        Args:
            id: The ID of the credential.
            revision: The revision number to revert to, or None to revert to
                the immediately previous revision.
        """
        # Return a dict, always with an attribute that specifies whether or not
        # the function was able to successfully get a result.
        ret = {'result': False}
        logging.info(
            'Attempting to revert credential to revision {}'.format(revision)
        )
        try:
            response = self._execute_request(
                'put',
                '{0}/v1/credentials/{1}/{2}'.format(
                    self.config['url'],
                    id,
                    revision,
                ),
                headers=JSON_HEADERS,
            )
        except RequestExecutionError:
            logging.exception('Error with executing request')
            return ret
        try:
            data = response.json()
        except ValueError:
            logging.error('Received badly formatted json data from confidant.')
            return ret
        ret['credential'] = data
        ret['result'] = True
        return ret
Reverts a credential to a previous revision.

        Args:
            id: The ID of the credential.
            revision: The revision number to revert to, or None to revert to
                the immediately previous revision.
        
Reverts a credential to a previous revision.
Reverts a credential to a previous revision .
def revert_credential(
            self,
            id,
            revision=None
            ):
        ret = {'result': False}
        logging.info(
            'Attempting to revert credential to revision {}'.format(revision)
        )
        try:
            response = self._execute_request(
                'put',
                '{0}/v1/credentials/{1}/{2}'.format(
                    self.config['url'],
                    id,
                    revision,
                ),
                headers=JSON_HEADERS,
            )
        except RequestExecutionError:
            logging.exception('Error with executing request')
            return ret
        try:
            data = response.json()
        except ValueError:
            logging.error('Received badly formatted json data from confidant.')
            return ret
        ret['credential'] = data
        ret['result'] = True
        return ret
def revert_credential ( self , id , revision = None ) : ret = { 'result' : False } logging . info ( 'Attempting to revert credential to revision {}' . format ( revision ) ) try : response = self . _execute_request ( 'put' , '{0}/v1/credentials/{1}/{2}' . format ( self . config [ 'url' ] , id , revision , ) , headers = JSON_HEADERS , ) except RequestExecutionError : logging . exception ( 'Error with executing request' ) return ret try : data = response . json ( ) except ValueError : logging . error ( 'Received badly formatted json data from confidant.' ) return ret ret [ 'credential' ] = data ret [ 'result' ] = True return ret
Reverts a credential to a previous revision.
Reverts a credential to a previous revision .
"""Reverts a credential to a previous revision.

        Args:
            id: The ID of the credential.
            revision: The revision number to revert to, or None to revert to
                the immediately previous revision.
        """ # Return a dict, always with an attribute that specifies whether or not # the function was able to successfully get a result.
self
id
The ID of the credential.
The ID of the credential .
revision
The revision number to revert to, or None to revert to
the immediately previous revision.
The revision number to revert to or None to revert to the immediately previous revision .