OpenIxia / ixnetwork_restpy

The IxNetwork python client.
https://openixia.github.io/ixnetwork_restpy/#/
MIT License
30 stars 16 forks source link

modification of attributes after commit not working for multivalue in Config Assistant #57

Closed Vibaswan closed 2 years ago

Vibaswan commented 3 years ago

Please refer the following script.

from ixnetwork_restpy import SessionAssistant

session_assistant = SessionAssistant(IpAddress='127.0.0.1', UserName='admin', Password='admin',
                                     LogLevel=SessionAssistant.LOGLEVEL_INFO, ClearConfig=True)
conf_assist = session_assistant.ConfigAssistant()
config = conf_assist.config
vport = config.Vport.add()
ethernet = config.Topology.add(Vports=vport).DeviceGroup.add().Ethernet.add()
ethernet.Mac.Single("00:11:00:00:22:00")
conf_assist.commit()

# modifying multivalue
ethernet.Mac.Increment(start_value="00:11:00:00:22:00", step_value="00:00:00:00:22:00")
conf_assist.commit()

Gives the following error

Traceback (most recent call last):
  File "C:/pycharm_projs/res/src/vlan test.py", line 43, in <module>
    ethernet.Mac.Increment(start_value="00:11:00:00:22:00", step_value="00:00:00:00:22:00")
  File "C:\pycharm_projs\res\venv\lib\site-packages\ixnetwork_restpy\testplatform\sessions\ixnetwork\topology\ethernet_18677f1f170027c217563a3250b1f635.py", line 770, in Mac
    return Multivalue(self, self._get_attribute(self._SDM_ATT_MAP['Mac']))
  File "C:\pycharm_projs\res\venv\lib\site-packages\ixnetwork_restpy\base.py", line 199, in _get_attribute
    return self._properties[name]
KeyError: 'mac'