mirror of
https://github.com/ansible-collections/community.routeros.git
synced 2025-07-22 11:54:34 +02:00
Fix crash when ssl parameter of api is used. (#3)
tested from me as well, thanks again !
This commit is contained in:
parent
5368e44f83
commit
3c0df4b343
2 changed files with 5 additions and 3 deletions
2
changelogs/fragments/3-api-ssl.yml
Normal file
2
changelogs/fragments/3-api-ssl.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "api - fix crash when the ``ssl`` parameter is used (https://github.com/ansible-collections/community.routeros/pull/3)."
|
|
@ -437,15 +437,15 @@ class ROS_api_module:
|
||||||
self.result['message'].append("%s" % e)
|
self.result['message'].append("%s" % e)
|
||||||
self.return_result(False, False)
|
self.return_result(False, False)
|
||||||
|
|
||||||
def ros_api_connect(self, username, password, host, port, ssl):
|
def ros_api_connect(self, username, password, host, port, use_ssl):
|
||||||
# connect to routeros api
|
# connect to routeros api
|
||||||
conn_status = {"connection": {"username": username,
|
conn_status = {"connection": {"username": username,
|
||||||
"hostname": host,
|
"hostname": host,
|
||||||
"port": port,
|
"port": port,
|
||||||
"ssl": ssl,
|
"ssl": use_ssl,
|
||||||
"status": "Connected"}}
|
"status": "Connected"}}
|
||||||
try:
|
try:
|
||||||
if ssl is True:
|
if use_ssl is True:
|
||||||
if not port:
|
if not port:
|
||||||
port = 8729
|
port = 8729
|
||||||
conn_status["connection"]["port"] = port
|
conn_status["connection"]["port"] = port
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue