From d949b33683ef9312dea3d885eb182912ffd22ef4 Mon Sep 17 00:00:00 2001 From: Jamil Atta Junior Date: Fri, 3 Feb 2017 13:48:06 -0200 Subject: [PATCH] Garantindo o param metadata como string para o GRPC --- opac_ssm_api/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opac_ssm_api/client.py b/opac_ssm_api/client.py index e4ee979..e70f726 100644 --- a/opac_ssm_api/client.py +++ b/opac_ssm_api/client.py @@ -1,7 +1,8 @@ # coding: utf-8 import os -import grpc import six +import grpc +import json import logging logger = logging.getLogger(__name__) @@ -74,7 +75,7 @@ def add_asset(self, pfile, filename='', filetype='', metadata=''): file=file_content, filename=filename, type=filetype, - metadata=str(metadata) + metadata=json.dumps(metadata) ) return self.stub.add_asset(asset).id