Package: pssh
Version: 1.4.3-1

Hi,

When sending the output to a directory (-o option), output files are
created with the host name.
If I put two nodes with the same host but different port in my hosts.txt
file, it works, but I get
only one result file.
In this case, the output file name should include the port.

I used the attached patch to fix the problem.

Thanks providing this package.

Marc


--
Marc MAURICE
Ingénieur Système et Réseaux

Smile - Open Source Solutions (www.smile.fr)
26, cours Gambetta - 34000 Montpellier
Tél : 04 99 77 20 17

Courriel : marc.maur...@smile.fr


--- psshlib/basethread.py.old	2008-10-12 13:16:02.000000000 +0200
+++ psshlib/basethread.py	2009-07-01 10:58:58.000000000 +0200
@@ -139,13 +139,16 @@
         self.sem.release()
 
     def write_output(self, stdout, stderr):
+        filename = self.host
+        if self.port != 22:
+		filename += ":" + str(self.port)
         if self.flags["outdir"]:
-            pathname = "%s/%s" % (self.flags["outdir"], self.host)
+            pathname = "%s/%s" % (self.flags["outdir"], filename)
             f = open(pathname, "w")
             self.write_wrap(f.fileno(), stdout.getvalue())
             f.close()
         if self.flags["errdir"]:
-            pathname = "%s/%s" % (self.flags["errdir"], self.host)
+            pathname = "%s/%s" % (self.flags["errdir"], filename)
             f = open(pathname, "w")
             self.write_wrap(f.fileno(), stderr.getvalue())
             f.close()

Reply via email to