Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle error seen when interface counter is not available in COUNTERS_DB #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/sonic_ax_impl/mibs/ietf/rfc2863.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ def _get_counter(self, oid, table_name, mask):
if oid in self.oid_lag_name_map:
counter_value = 0
for lag_member in self.lag_name_if_name_map[self.oid_lag_name_map[oid]]:
counter_value += self._get_counter(mibs.get_index_from_str(lag_member), table_name, mask)
member_counter = self._get_counter(mibs.get_index_from_str(lag_member), table_name, mask)
if member_counter:
counter_value += member_counter

return counter_value & mask

Expand Down
16 changes: 12 additions & 4 deletions src/sonic_ax_impl/mibs/vendor/cisco/ciscoPfcExtMIB.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ def cpfc_if_requests(self, sub_id):
if oid in self.oid_lag_name_map:
counter_value = 0
for lag_member in self.lag_name_if_name_map[self.oid_lag_name_map[oid]]:
counter_value += self._get_counter(mibs.get_index_from_str(lag_member), counter_name)
member_counter = self._get_counter(mibs.get_index_from_str(lag_member), counter_name)
if member_counter:
counter_value += member_counter

return counter_value
else:
Expand All @@ -143,7 +145,9 @@ def cpfc_if_indications(self, sub_id):
if oid in self.oid_lag_name_map:
counter_value = 0
for lag_member in self.lag_name_if_name_map[self.oid_lag_name_map[oid]]:
counter_value += self._get_counter(mibs.get_index_from_str(lag_member), counter_name)
member_counter = self._get_counter(mibs.get_index_from_str(lag_member), counter_name)
if member_counter:
counter_value += member_counter

return counter_value
else:
Expand Down Expand Up @@ -215,7 +219,9 @@ def requests_per_priority(self, sub_id):
if port_oid in self.oid_lag_name_map:
counter_value = 0
for lag_member in self.lag_name_if_name_map[self.oid_lag_name_map[port_oid]]:
counter_value += self._get_counter(mibs.get_index_from_str(lag_member), counter_name)
member_counter = self._get_counter(mibs.get_index_from_str(lag_member), counter_name)
if member_counter:
counter_value += member_counter

return counter_value
else:
Expand Down Expand Up @@ -245,7 +251,9 @@ def indications_per_priority(self, sub_id):
if port_oid in self.oid_lag_name_map:
counter_value = 0
for lag_member in self.lag_name_if_name_map[self.oid_lag_name_map[port_oid]]:
counter_value += self._get_counter(mibs.get_index_from_str(lag_member), counter_name)
member_counter = self._get_counter(mibs.get_index_from_str(lag_member), counter_name)
if member_counter:
counter_value += member_counter

return counter_value
else:
Expand Down
Loading