def deserialize(self, data): token_data = msgpackutils.loads(data, registry=self._registry) try: token_model = TokenModel() for k, v in iter(token_data.items()): setattr(token_model, k, v) except Exception: LOG.debug("Failed to deserialize TokenModel. Data is %s", token_data) raise exception.CacheDeserializationError(TokenModel.__name__, token_data) return token_model
def deserialize(self, data): receipt_data = msgpackutils.loads(data, registry=self._registry) try: receipt_model = ReceiptModel() for k, v in iter(receipt_data.items()): setattr(receipt_model, k, v) except Exception: LOG.debug("Failed to deserialize ReceiptModel. Data is %s", receipt_data) raise exception.CacheDeserializationError(ReceiptModel.__name__, receipt_data) return receipt_model