def execute(self, command,
sudo = False,
- stdin = None,
env = None,
tty = False,
forward_x11 = False,
(out, err), proc = execfuncs.lexec(command,
user = self.get("username"), # still problem with localhost
sudo = sudo,
- stdin = stdin,
env = env)
else:
if with_lock:
+ # If the execute command is blocking, we don't want to keep
+ # the node lock. This lock is used to avoid race conditions
+ # when creating the ControlMaster sockets. A more elegant
+ # solution is needed.
with self._node_lock:
(out, err), proc = sshfuncs.rexec(
command,
port = self.get("port"),
agent = True,
sudo = sudo,
- stdin = stdin,
identity = self.get("identity"),
server_key = self.get("serverKey"),
env = env,
port = self.get("port"),
agent = True,
sudo = sudo,
- stdin = stdin,
identity = self.get("identity"),
server_key = self.get("serverKey"),
env = env,
recursive = True,
strict_host_checking = False)
else:
- with self._node_lock:
- (out, err), proc = sshfuncs.rcopy(
- src, dst,
- port = self.get("port"),
- identity = self.get("identity"),
- server_key = self.get("serverKey"),
- recursive = True,
- strict_host_checking = False)
+ (out, err), proc = sshfuncs.rcopy(
+ src, dst,
+ port = self.get("port"),
+ identity = self.get("identity"),
+ server_key = self.get("serverKey"),
+ recursive = True,
+ strict_host_checking = False)
return (out, err), proc