@@ -240,12 +240,12 @@ def exec_command(self, command, sudo=False, user=None, **kwargs):
240240 self ._read_output_buffer (_stderr ,
241241 prefix = '\t [err]' )
242242 if sudo and not user :
243- command = 'sudo -S bash -c "%s" ' % command .replace ('"' , '\\ "' )
243+ command = 'sudo -S bash -c \' %s \' ' % command .replace ('"' , '\\ "' )
244244 elif user :
245- command = 'sudo -u %s -S bash -c "%s" ' % (
245+ command = 'sudo -u %s -S bash -c \' %s \' ' % (
246246 user , command .replace ('"' , '\\ "' ),)
247247 else :
248- command = 'bash -c "%s" ' % command .replace ('"' , '\\ "' )
248+ command = 'bash -c \' %s \' ' % command .replace ('"' , '\\ "' )
249249 logger .debug ("Running command %s on %s" , command , self .host )
250250 channel .exec_command (command , ** kwargs )
251251 logger .debug ("Command started" )
@@ -320,7 +320,7 @@ class ParallelSSHClient(object):
320320
321321 def __init__ (self , hosts ,
322322 user = None , password = None , port = None , pkey = None ,
323- forward_ssh_agent = True , num_retries = DEFAULT_RETRIES , timeout = None ,
323+ forward_ssh_agent = True , num_retries = DEFAULT_RETRIES , timeout = 120 ,
324324 pool_size = 10 , proxy_host = None , proxy_port = 22 ):
325325 """
326326 :param hosts: Hosts to connect to
0 commit comments