I have to run several commands in different folders over the same server and I need to execute this commands in parallel.
I tried with Threads but I'm getting SSH errors in the threads. Errors like these
Exception in thread Thread-32:
Traceback (most recent call last):
File "/app/data/software/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/app/data/software/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "/app/scripts/fabric/nyx/deploy/deploy_base.py", line 252, in doRunParallelCommands
if exists('%s/settings.php' % site_info['site_path']):
File "/app/data/software/lib/python2.7/site-packages/fabric/contrib/files.py", line 35, in exists
return not func(cmd).failed
File "/app/data/software/lib/python2.7/site-packages/fabric/network.py", line 463, in host_prompting_wrapper
return func(*args, **kwargs)
File "/app/data/software/lib/python2.7/site-packages/fabric/operations.py", line 909, in run
return _run_command(command, shell, pty, combine_stderr)
File "/app/data/software/lib/python2.7/site-packages/fabric/operations.py", line 819, in _run_command
stdout, stderr, status = _execute(default_channel(), wrapped_command, pty,
File "/app/data/software/lib/python2.7/site-packages/fabric/state.py", line 340, in default_channel
chan = connections[env.host_string].get_transport().open_session()
File "/app/data/software/lib/python2.7/site-packages/ssh/transport.py", line 660, in open_session
return self.open_channel('session')
File "/app/data/software/lib/python2.7/site-packages/ssh/transport.py", line 771, in open_channel
raise e
SSHException: Unable to open channel.
Exception in thread Thread-50:
Traceback (most recent call last):
File "/app/data/software/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/app/data/software/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "/app/scripts/fabric/nyx/deploy/deploy_base.py", line 252, in doRunParallelCommands
if exists('%s/settings.php' % site_info['site_path']):
File "/app/data/software/lib/python2.7/site-packages/fabric/contrib/files.py", line 35, in exists
return not func(cmd).failed
File "/app/data/software/lib/python2.7/site-packages/fabric/network.py", line 463, in host_prompting_wrapper
return func(*args, **kwargs)
File "/app/data/software/lib/python2.7/site-packages/fabric/operations.py", line 909, in run
return _run_command(command, shell, pty, combine_stderr)
File "/app/data/software/lib/python2.7/site-packages/fabric/operations.py", line 819, in _run_command
stdout, stderr, status = _execute(default_channel(), wrapped_command, pty,
File "/app/data/software/lib/python2.7/site-packages/fabric/state.py", line 340, in default_channel
chan = connections[env.host_string].get_transport().open_session()
File "/app/data/software/lib/python2.7/site-packages/ssh/transport.py", line 660, in open_session
return self.open_channel('session')
File "/app/data/software/lib/python2.7/site-packages/ssh/transport.py", line 771, in open_channel
raise e
ChannelException: Administratively prohibited