Skip to content

Commit

Permalink
Merge pull request #703 from gbregman/devel
Browse files Browse the repository at this point in the history
Add ignore_unknown_fields to json_format.Parse() calls
  • Loading branch information
gbregman authored Jun 5, 2024
2 parents 8044d72 + d4d1eae commit 5229eea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions control/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def gateway_rpc_caller(self, requests, is_add_req):
for key, val in requests.items():
if key.startswith(GatewayState.SUBSYSTEM_PREFIX):
if is_add_req:
req = json_format.Parse(val, pb2.create_subsystem_req())
req = json_format.Parse(val, pb2.create_subsystem_req(), ignore_unknown_fields=True)
self.gateway_rpc.create_subsystem(req)
else:
req = json_format.Parse(val,
Expand All @@ -538,7 +538,7 @@ def gateway_rpc_caller(self, requests, is_add_req):
self.gateway_rpc.delete_subsystem(req)
elif key.startswith(GatewayState.NAMESPACE_PREFIX):
if is_add_req:
req = json_format.Parse(val, pb2.namespace_add_req())
req = json_format.Parse(val, pb2.namespace_add_req(), ignore_unknown_fields=True)
self.gateway_rpc.namespace_add(req)
else:
req = json_format.Parse(val,
Expand All @@ -547,21 +547,21 @@ def gateway_rpc_caller(self, requests, is_add_req):
self.gateway_rpc.namespace_delete(req)
elif key.startswith(GatewayState.NAMESPACE_QOS_PREFIX):
if is_add_req:
req = json_format.Parse(val, pb2.namespace_set_qos_req())
req = json_format.Parse(val, pb2.namespace_set_qos_req(), ignore_unknown_fields=True)
self.gateway_rpc.namespace_set_qos_limits(req)
else:
# Do nothing, this is covered by the delete namespace code
pass
elif key.startswith(GatewayState.HOST_PREFIX):
if is_add_req:
req = json_format.Parse(val, pb2.add_host_req())
req = json_format.Parse(val, pb2.add_host_req(), ignore_unknown_fields=True)
self.gateway_rpc.add_host(req)
else:
req = json_format.Parse(val, pb2.remove_host_req(), ignore_unknown_fields=True)
self.gateway_rpc.remove_host(req)
elif key.startswith(GatewayState.LISTENER_PREFIX):
if is_add_req:
req = json_format.Parse(val, pb2.create_listener_req())
req = json_format.Parse(val, pb2.create_listener_req(), ignore_unknown_fields=True)
self.gateway_rpc.create_listener(req)
else:
req = json_format.Parse(val, pb2.delete_listener_req(), ignore_unknown_fields=True)
Expand Down

0 comments on commit 5229eea

Please sign in to comment.