Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/zfslib/zfslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ class Connection:
_trust = False
_props_last = None

def __init__(self, host="localhost", trust=False, sshcipher=None, identityfile=None, knownhostsfile=None, verbose=False):
def __init__(self, host="localhost", user=None, port=22, trust=False, sshcipher=None, identityfile=None, knownhostsfile=None, verbose=False):
self.host = host
self.user = user
self.port = str(port)
self._trust = trust
self._poolset = PoolSet(self)
self.verbose = verbose
self._pools_loaded = False
if host in ['localhost','127.0.0.1']:
self.command = []

else:
self.command = ["ssh","-o","BatchMode=yes","-a","-x"]
self.command.extend(["-p", self.port])
if self._trust:
self.command.extend(["-o","CheckHostIP=no"])
self.command.extend(["-o","StrictHostKeyChecking=no"])
Expand All @@ -47,7 +51,10 @@ def __init__(self, host="localhost", trust=False, sshcipher=None, identityfile=N
self.command.extend(["-i",identityfile])
if knownhostsfile != None:
self.command.extend(["-o","UserKnownHostsFile=%s" % knownhostsfile])
self.command.extend([self.host])
if self.user == None:
self.command.extend([self.host])
else:
self.command.extend([self.user + "@" + self.host])



Expand Down