OpenIxia / IxNetwork

A central location for IxNetwork sample scripts and utilities. Please also visit http://openixia.com
MIT License
50 stars 59 forks source link

uninitialised self.logInfo #82

Closed VdWWouter closed 4 years ago

VdWWouter commented 4 years ago

I'm trying out IxNetwork with python and robotframework, but ran into some trouble.

failed: AttributeError: 'NoneType' object has no attribute 'log_to_console'
Traceback (most recent call last):
  File "<...>/IxNetwork/RestApi/Python/Modules/IxNetRestApi.py", line 195, in __init__
    self.logInfo('Connecting to API server: linux')
  File "<...>/IxNetwork/RestApi/Python/Modules/IxNetRestApi.py", line 767, in logInfo
    self.robotStdout.log_to_console(msg)

Further investigation showed that in IxNetwork/RestApi/Python/Modules/IxNetRestApi.py (commit 12ff5df) attribute self.logInfo is referenced on line 195 and is assigned a value on line 230.

Moving the if statement (line 228: if self.robotFrameworkStdout:) up, fixed it for me. A diff of the file I modified and the master: logInfo.txt

hubertgee commented 4 years ago

Fixed. Robot scripts works now.