Skip to content

Commit aba31d6

Browse files
committed
Revert "Fix SNMPv3 configuration on Edge Filers (#319)"
This reverts commit ddd7c5d.
1 parent ddd7c5d commit aba31d6

3 files changed

Lines changed: 3 additions & 12 deletions

File tree

cterasdk/edge/snmp.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def enable(self, port=161, community_str=None, username=None, auth_password=None
3737
param.readCommunity = community_str
3838
if username is not None and auth_password is not None and privacy_password is not None:
3939
param.snmpV3 = Object()
40-
param.snmpV3._classname = 'SnmpV3Config' # pylint: disable=protected-access
4140
param.snmpV3.mode = enum.Mode.Enabled
4241
param.snmpV3.username = username
4342
param.snmpV3.authenticationPassword = auth_password
@@ -54,15 +53,9 @@ def disable(self):
5453
logger.info("Disabled SNMP.")
5554

5655
def get_configuration(self):
57-
"""
58-
Get current SNMP configuration
59-
60-
:return: Current SNMP configuration
61-
:rtype: cterasdk.common.object.Object
62-
"""
6356
return self._edge.api.get('/config/snmp')
6457

65-
def modify(self, port=161, community_str=None, username=None, auth_password=None, privacy_password=None):
58+
def modify(self, port=None, community_str=None, username=None, auth_password=None, privacy_password=None):
6659
"""
6760
Modify current SNMP configuration. Only configurations that are not `None` will be changed. SNMP must be enabled
6861
@@ -75,12 +68,12 @@ def modify(self, port=161, community_str=None, username=None, auth_password=None
7568
current_config = self.get_configuration()
7669
if current_config.mode == enum.Mode.Disabled:
7770
raise CTERAException("SNMP configuration cannot be modified when disabled")
78-
current_config.port = port
71+
if port:
72+
current_config.port = port
7973
if community_str:
8074
current_config.readCommunity = community_str
8175
if username is not None and auth_password is not None and privacy_password is not None:
8276
current_config.snmpV3 = Object()
83-
current_config.snmpV3._classname = 'SnmpV3Config' # pylint: disable=protected-access
8477
current_config.snmpV3.mode = enum.Mode.Enabled
8578
current_config.snmpV3.username = username
8679
current_config.snmpV3.authenticationPassword = auth_password

docs/source/UserGuides/Miscellaneous/Changelog.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Improvements
2626
Bug Fixes
2727
^^^^^^^^^
2828

29-
* Fixed SNMPv3 configuration on Edge Filers - added missing XML class name for proper serialization
3029
* Corrected Direct I/O object class references in the documentation
3130

3231
.. code:: python

tests/ut/edge/test_snmp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def _get_snmp_object(self, port=None, community_str=None, username=None, auth_pa
7676
param.readCommunity = community_str
7777
if username is not None and auth_password is not None and privacy_password is not None:
7878
param.snmpV3 = Object()
79-
param.snmpV3._classname = 'SnmpV3Config' # pylint: disable=protected-access
8079
param.snmpV3.mode = Mode.Enabled
8180
param.snmpV3.username = username
8281
param.snmpV3.authenticationPassword = auth_password

0 commit comments

Comments
 (0)