X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FPolicer.py;h=9e14a4fd582ee69da2b00d46f8438806cd5db654;hp=c72212914b0b908cc8fc1b2532d12bf475daa46c;hb=545216fdee77b0b9ddc8d5e8c0f2e5662cacea76;hpb=4c6fe5602edcbd9857a846e5b13a21d5c671a2c8 diff --git a/resources/libraries/python/Policer.py b/resources/libraries/python/Policer.py index c72212914b..9e14a4fd58 100644 --- a/resources/libraries/python/Policer.py +++ b/resources/libraries/python/Policer.py @@ -109,7 +109,6 @@ class PolicerClassifyTableType(Enum): self.string = string -# pylint: disable=too-many-instance-attributes class Policer(object): """Policer utilities.""" @@ -145,7 +144,6 @@ class Policer(object): # create policer color_aware = 'color-aware' if self._color_aware else '' - # pylint: disable=no-member conform_action = self._conform_action.value if PolicerAction.MARK_AND_TRANSMIT == self._conform_action: @@ -213,7 +211,7 @@ class Policer(object): node, "policer/policer_classify_add_session.vat", policer_index=policer_index, - pre_color=self._classify_precolor.value, # pylint: disable=no-member + pre_color=self._classify_precolor.value, table_index=new_table_index, skip_n=skip_n_vectors, match_n=match_n_vectors, @@ -228,7 +226,7 @@ class Policer(object): node, "policer/policer_classify_set_interface.vat", sw_if_index=self._sw_if_index, - table_type=table_type.value, # pylint: disable=no-member + table_type=table_type.value, table_index=new_table_index) VatJsonUtil.verify_vat_retval( @@ -294,17 +292,23 @@ class Policer(object): """Set policer CB. :param cb: Committed Burst size. - :type cb: int + :type cb: int or str """ - self._cb = cb + if cb == "IMIX_v4_1": + self._cb = 1518 + else: + self._cb = cb def policer_set_eb(self, eb): """Set policer EB. :param eb: Excess Burst size. - :type eb: int + :type eb: int or str """ - self._eb = eb + if eb == "IMIX_v4_1": + self._eb = 1518 + else: + self._eb = eb def policer_set_rate_type_kbps(self): """Set policer rate type to kbps."""