Skip to content

Commit

Permalink
[meta] Fix tests to be backward compatible (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored Jun 1, 2020
1 parent ebdf4ff commit 0a77a09
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion meta/saiserialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,13 @@ void sai_deserialize_enum(
}
}

// for backward compatibility from SAI v1.6
if (s == "SAI_NEXT_HOP_GROUP_TYPE_ECMP")
{
value = SAI_NEXT_HOP_GROUP_TYPE_ECMP;
return;
}

SWSS_LOG_WARN("enum %s not found in enum %s", s.c_str(), meta->name);

sai_deserialize_number(s, value);
Expand Down Expand Up @@ -2090,7 +2097,16 @@ void sai_deserialize_qos_map_params(
params.prio = j["prio"];
params.pg = j["pg"];
params.queue_index = j["qidx"];
params.mpls_exp = j["mpls_exp"];

if (j.find("mpls_exp") == j.end())
{
// for backward compatibility
params.mpls_exp = 0;
}
else
{
params.mpls_exp = j["mpls_exp"];
}

sai_deserialize_packet_color(j["color"], params.color);
}
Expand Down

0 comments on commit 0a77a09

Please sign in to comment.