huawei-lte-api
huawei-lte-api copied to clipboard
Exception on log-out ResponseErrorWrongSessionToken: 125003: Wrong Session Token
As mentioned in #159 :
One last addition : logout seems to fail on my hardware even with an account set, as shown below : EDIT: this behaviour is common to 1.6.4 and 1.6.7 when using default account
# ./data_dump.py --username admin --password admin http://192.168.8.1
...
==== Developer.atport_status
100002: No support
Traceback (most recent call last):
File "/home/npillot/huawei-lte-api_1.6.7/examples/./data_dump.py", line 334, in <module>
dump(client.developer.atport_status)
File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Connection.py", line 54, in __exit__
self.close()
File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Connection.py", line 42, in close
self.user_session.close()
File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/api/User.py", line 30, in close
self.user.logout()
File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/api/User.py", line 115, in logout
return self._session.post_set('user/logout', {
File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Session.py", line 215, in post_set
self._post(endpoint, data, refresh_csrf, prefix, is_encrypted, is_json)
File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Session.py", line 34, in wrapped
return fn(*args, **kw)
File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Session.py", line 254, in _post
response_data = cast(str, self._check_response_status(self._process_response_data(response)))
File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Session.py", line 156, in _check_response_status
raise error_code_to_exception.get(error_code, ResponseErrorException)(
huawei_lte_api.exceptions.ResponseErrorWrongSessionToken: 125003: Wrong Session Token
Should be fixed in https://github.com/Salamek/huawei-lte-api/pull/169 i guess...
Hm, I'm not sure, in #169 ResponseErrorLoginRequiredException and ResponseErrorNotSupportedException are the suppressed exceptions, whereas here ResponseErrorWrongSessionToken is raised.
Then again I might be missing something. Or then again ResponseErrorWrongSessionToken could be similarly suppressed as the other two, doesn't seem there's anything that could be done about that as far as closing a session goes either.
Oh, you are right, wrong exception