@@ -336,8 +336,7 @@ def __init__(self, hosts,
336
336
self .channel_timeout = channel_timeout
337
337
338
338
def run_command (self , command , sudo = False , user = None , stop_on_errors = True ,
339
- shell = None , use_shell = True , use_pty = True , host_args = None ,
340
- environment = None ):
339
+ shell = None , use_shell = True , use_pty = True , host_args = None ):
341
340
"""Run command on all hosts in parallel, honoring self.pool_size,
342
341
and return output buffers.
343
342
@@ -384,10 +383,6 @@ def run_command(self, command, sudo=False, user=None, stop_on_errors=True,
384
383
host list - :py:class:`pssh.exceptions.HostArgumentException` is raised \
385
384
otherwise
386
385
:type host_args: tuple or list
387
- :param environment: (Optional) Environment variables to be exposed to \
388
- command to be run. This requires that ``AcceptEnv`` server setting \
389
- is enabled - variables will silently not be set otherwise
390
- :type environment: dict
391
386
392
387
:rtype: Dictionary with host as key and \
393
388
:py:class:`pssh.output.HostOutput` as value as per \
@@ -630,8 +625,7 @@ def run_command(self, command, sudo=False, user=None, stop_on_errors=True,
630
625
cmds = [self .pool .spawn (self ._exec_command , host ,
631
626
command % host_args [host_i ],
632
627
sudo = sudo , user = user , shell = shell ,
633
- use_shell = use_shell , use_pty = use_pty ,
634
- environment = environment )
628
+ use_shell = use_shell , use_pty = use_pty )
635
629
for host_i , host in enumerate (self .hosts )]
636
630
except IndexError :
637
631
raise HostArgumentException (
@@ -641,8 +635,7 @@ def run_command(self, command, sudo=False, user=None, stop_on_errors=True,
641
635
cmds = [self .pool .spawn (
642
636
self ._exec_command , host , command ,
643
637
sudo = sudo , user = user , shell = shell ,
644
- use_shell = use_shell , use_pty = use_pty ,
645
- environment = environment )
638
+ use_shell = use_shell , use_pty = use_pty )
646
639
for host in self .hosts ]
647
640
for cmd in cmds :
648
641
try :
@@ -660,8 +653,7 @@ def _get_host_config_values(self, host):
660
653
return _user , _port , _password , _pkey
661
654
662
655
def _exec_command (self , host , command , sudo = False , user = None ,
663
- shell = None , use_shell = True , use_pty = True ,
664
- environment = None ):
656
+ shell = None , use_shell = True , use_pty = True ):
665
657
"""Make SSHClient, run command on host"""
666
658
if host not in self .host_clients or self .host_clients [host ] is None :
667
659
_user , _port , _password , _pkey = self ._get_host_config_values (host )
@@ -682,7 +674,7 @@ def _exec_command(self, host, command, sudo=False, user=None,
682
674
channel_timeout = self .channel_timeout )
683
675
return self .host_clients [host ].exec_command (
684
676
command , sudo = sudo , user = user , shell = shell ,
685
- use_shell = use_shell , use_pty = use_pty , environment = environment )
677
+ use_shell = use_shell , use_pty = use_pty )
686
678
687
679
def get_output (self , cmd , output ):
688
680
"""Get output from command.
0 commit comments