Skip to content

Commit 48650b8

Browse files
committed
Make a Merge() call allow not-yet-recognized new fields in P4Info files
This is helpful when p4c adds new P4Info fields to the P4Info files it generates, but the consumers have not yet all been updated to recognize them. The most recent example of this in 2024-Aug is the initial_default_action field of Table messages. Signed-off-by: Andy Fingerhut <[email protected]>
1 parent 8869f64 commit 48650b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

p4runtime_sh/p4runtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def set_fwd_pipe_config(self, p4info_path, bin_path):
289289
with open(p4info_path, 'r') as f1:
290290
with open(bin_path, 'rb') as f2:
291291
try:
292-
google.protobuf.text_format.Merge(f1.read(), req.config.p4info)
292+
google.protobuf.text_format.Merge(f1.read(), req.config.p4info, allow_unknown_field=True)
293293
except google.protobuf.text_format.ParseError:
294294
logging.error("Error when parsing P4Info")
295295
raise

0 commit comments

Comments
 (0)