Переглянути джерело

bugfix:修复ListSSLCert方法解析证书列表出错的问题

YuXinLong 1 рік тому
батько
коміт
79168dd0fc
2 змінених файлів з 7 додано та 7 видалено
  1. 1 1
      proto
  2. 6 6
      src/main.py

+ 1 - 1
proto

@@ -1 +1 @@
-Subproject commit fd50462f6a8a6773c39cb1e6aeee94eeb5392038
+Subproject commit 15ffd7fb7a6ea24e9a8bf1001c1cd0ff4692ecea

+ 6 - 6
src/main.py

@@ -39,10 +39,10 @@ def delivery_to_grpc(delivery):
     )
     )
 
 
 
 
-def cert_list_to_grpc(cert):
+def cert_list_to_grpc(results):
     return Cert(
     return Cert(
-        certName=cert.get('certName', None),
-        certStatus=cert.get('certStatus', None)
+        certName=results['body']['certName'],
+        certStatus=results['body']['certStatus']
     )
     )
 
 
 
 
@@ -363,13 +363,13 @@ class CertDeliveryServiceServicer(llnwCERT_pb2_grpc.CertDeliveryServiceServicer)
         else:
         else:
             return check_cert_withdraw_error(res)
             return check_cert_withdraw_error(res)
 
 
-    def GetCertList(self, request, context):
-        print("GetCertList")
+    def ListSSLCert(self, request, context):
+        print("ListSSLCert")
         print("请求:", request)
         print("请求:", request)
         res = get_cl(request.base).list_customer_certificates(shortname=request.shortname).json()
         res = get_cl(request.base).list_customer_certificates(shortname=request.shortname).json()
         print("响应:", res)
         print("响应:", res)
         check_error(res, context)
         check_error(res, context)
-        return ListSSLCertResponse(certList=CertList([cert_list_to_grpc(results) for results in res['results']]))
+        return ListSSLCertResponse(certList=CertList(cert=[cert_list_to_grpc(results=results) for results in res['results']]))
 
 
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':