

def _get_secret_data(self, secret, payload_content_type='application/octet-stream'):
    'Retrieves the secret data given a secret and content_type.\n\n        :param ctxt: contains information of the user and the environment for\n                     the request (nova/context.py)\n        :param secret: the secret from barbican with the payload of data\n        :param payload_content_type: the format/type of the secret data\n\n        :returns: the secret data\n        :raises Exception: if data cannot be retrieved\n        '
    try:
        generated_data = secret.payload
        if (payload_content_type == 'application/octet-stream'):
            secret_data = base64.b64encode(generated_data)
        else:
            secret_data = generated_data
        return secret_data
    except Exception as e:
        with excutils.save_and_reraise_exception():
            LOG.error(_LE('Error getting secret data: %s'), e)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/keymgr/barbican.py BarbicanKeyManager._get_secret_data/original