-
Notifications
You must be signed in to change notification settings - Fork 68
Closed as duplicate of#290
Description
I've used transport as http_certs. My .conf file looks like below where I've provided path to signed certificate and private key files,
[connection:dut]
host: 10.10.10.1
transport: https_certs
cert_file: "/Users/roopesh/Desktop/projects/pyapi-test/cert.pem"
key_file: "/Users/roopesh/Desktop/projects/pyapi-test/key.pem"
Also here's my simple python script,
import pyeapi
pyeapi.load_config('nodes.conf')
node = pyeapi.connect_to('dut')
config = node.get_config('running-config')
print(config)
When I ran the above script, I got the following error,
roopesh:pyapi-test/ $ /Users/roopesh/Desktop/projects/pyapi-test/.venv/bin/python /Users/roopesh/Desktop/projects/pyapi-test/main.py [10:03:14]
Traceback (most recent call last):
File "/Users/roopesh/Desktop/projects/pyapi-test/main.py", line 4, in <module>
node = pyeapi.connect_to('dut')
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/roopesh/Desktop/projects/pyapi-test/.venv/lib/python3.12/site-packages/pyeapi/client.py", line 1046, in connect_to
node = connect(return_node=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/roopesh/Desktop/projects/pyapi-test/.venv/lib/python3.12/site-packages/pyeapi/client.py", line 453, in connect
connection = make_connection(transport, host=host, username=username,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/roopesh/Desktop/projects/pyapi-test/.venv/lib/python3.12/site-packages/pyeapi/client.py", line 391, in make_connection
return klass(**kwargs)
^^^^^^^^^^^^^^^
File "/Users/roopesh/Desktop/projects/pyapi-test/.venv/lib/python3.12/site-packages/pyeapi/eapilib.py", line 708, in __init__
self.transport = HTTPSCertConnection(path, host, int(port),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/roopesh/Desktop/projects/pyapi-test/.venv/lib/python3.12/site-packages/pyeapi/eapilib.py", line 222, in __init__
HTTPSConnection.__init__(self, host, key_file=key_file,
TypeError: HTTPSConnection.__init__() got an unexpected keyword argument 'key_file'
It seems key_file argument is not properly handled.
Metadata
Metadata
Assignees
Labels
No labels