aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2023-02-07 13:38:22 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2023-02-07 13:38:22 +0100
commit31661017765371d5426f4d7244d33d994afb7365 (patch)
treeb7ae47dccc88ae80269a4041747851d2a10be580
parent271a46d36d13dafe6224f93d8cfbf13c7ae96a4d (diff)
downloadautomato-31661017765371d5426f4d7244d33d994afb7365.tar.gz
SshTransport
-rw-r--r--automato/transport.py5
-rw-r--r--endpoints.yml1
2 files changed, 4 insertions, 2 deletions
diff --git a/automato/transport.py b/automato/transport.py
index ffee1d6..64c3db6 100644
--- a/automato/transport.py
+++ b/automato/transport.py
@@ -57,13 +57,14 @@ class Transport:
class SshTransport(Transport):
CONNECTION=HOLD
- def __init__(self, hostname: str, port=22, username='root', password = None, id_file = None):
+ def __init__(self, hostname: str, port=22, username='root', password = None, id_file = None, allow_agent=False):
super().__init__()
self._hostname = hostname
self._port = port
self._username = username
self._password = password
self._id_file = id_file
+ self._allow_agent = allow_agent
self._client = None
@@ -72,7 +73,7 @@ class SshTransport(Transport):
# TODO known hosts
self._client.set_missing_host_key_policy(paramiko.client.AutoAddPolicy)
- self._client.connect(self._hostname, port=self._port, username=self._username, password=self._password, key_filename=None, allow_agent=True)
+ self._client.connect(self._hostname, port=self._port, username=self._username, password=self._password, key_filename=self._id_file, allow_agent=self._allow_agent)
self._connected = True
diff --git a/endpoints.yml b/endpoints.yml
index c4d35bc..26d5340 100644
--- a/endpoints.yml
+++ b/endpoints.yml
@@ -4,6 +4,7 @@ host1:
class: automato.transport.SshTransport
hostname: 'localhost'
username: 'jonas'
+ allow_agent: True
commands:
notify:
class: automato.command.NotifyCommand