[Python-modules-commits] [parallax] 01/06: Import parallax_1.0.2.orig.tar.gz

Valentin Vidic vvidic-guest at moszumanska.debian.org
Mon Sep 18 18:19:19 UTC 2017


This is an automated email from the git hooks/post-receive script.

vvidic-guest pushed a commit to branch master
in repository parallax.

commit 628f08d1bcf5e372db15017ef5adbcc4be05f901
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Mon Sep 18 19:10:01 2017 +0200

    Import parallax_1.0.2.orig.tar.gz
---
 MANIFEST.in                            |  6 +++
 PKG-INFO                               |  2 +-
 README                                 | 76 ++++++++++++++++++++++++++++++++++
 PKG-INFO => parallax.egg-info/PKG-INFO |  2 +-
 parallax.egg-info/SOURCES.txt          | 21 ++++++++++
 parallax.egg-info/dependency_links.txt |  1 +
 parallax.egg-info/top_level.txt        |  1 +
 parallax/__init__.py                   | 12 +++---
 parallax/manager.py                    |  2 +
 parallax/version.py                    |  2 +-
 setup.cfg                              |  4 ++
 setup.py                               |  2 +-
 test/test_api.py                       | 18 ++++----
 13 files changed, 131 insertions(+), 18 deletions(-)

diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..7baf850
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,6 @@
+# Determines which files are included in sdist and bdist.
+# MANIFEST.in docs: http://docs.python.org/distutils/commandref.html
+
+include COPYING
+include AUTHORS
+include README
diff --git a/PKG-INFO b/PKG-INFO
index a9885d4..b45ff60 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: parallax
-Version: 1.0.1
+Version: 1.0.2
 Summary: Execute commands and copy files over SSH to multiple machines at once
 Home-page: https://github.com/krig/parallax/
 Author: Kristoffer Gronlund
diff --git a/README b/README
new file mode 100644
index 0000000..beb5620
--- /dev/null
+++ b/README
@@ -0,0 +1,76 @@
+# Parallax SSH
+
+Parallax SSH is a fork of [Parallel SSH][pssh] which focuses less on
+command-line tools and more on providing a flexible and programmable
+API that can be used by Python application developers to perform SSH
+operations across multiple machines.
+
+## Installation
+
+Parallax intends to be compatible with Python 2.6 and above (including
+Python 3.1 and greater), but is primarily tested with Python 2.7.
+
+Installation requires setuptools or ez_setup.py. The latter can be
+downloaded [here][ez].
+
+Once those requirements are fulfilled, installation is as simple as:
+
+    # sudo python setup.py install
+
+Packaged versions of Parallax SSH for various distributions can be
+downloaded from the openSUSE [OBS][obs].
+
+To install via PyPI, use `pip`:
+
+    # pip install parallax
+
+Share and enjoy!
+
+## Usage
+
+* `parallax.call(hosts, cmdline, opts)`
+
+  Executes the given command on a set of hosts, collecting the output.
+
+  Returns a dict mapping the hostname of
+  each host either to a tuple containing a return code,
+  stdout and stderr, or an `parallax.Error` instance
+  describing the error.
+
+* `parallax.copy(hosts, src, dst, opts)`
+
+  Copies files from `src` on the local machine to `dst` on the
+  remote hosts.
+
+  Returns a dict mapping the hostname of
+  each host either to a path, or an `parallax.Error` instance
+  describing the error.
+
+* `parallax.slurp(hosts, src, dst, opts)`
+
+  Copies files from `src` on the remote hosts to a local folder for
+  each of the remote hosts.
+
+  Returns a dict mapping the hostname of
+  each host either to a path, or an `parallax.Error` instance
+  describing the error.
+
+## How it works
+
+By default, Parallax SSH uses at most 32 SSH process in parallel to
+SSH to the nodes. By default, it uses a timeout of one minute to SSH
+to a node and obtain a result.
+
+## Environment variables
+
+* `PARALLAX_HOSTS`
+* `PARALLAX_USER`
+* `PARALLAX_PAR`
+* `PARALLAX_OUTDIR`
+* `PARALLAX_VERBOSE`
+* `PARALLAX_OPTIONS`
+
+
+  [pssh]: https://code.google.com/p/parallel-ssh/ "parallel-ssh"
+  [ez]: http://peak.telecommunity.com/dist/ez_setup.py "ez_setup.py"
+  [obs]: https://build.opensuse.org/package/show/devel:languages:python/python-parallax "OBS:python-parallax"
diff --git a/PKG-INFO b/parallax.egg-info/PKG-INFO
similarity index 98%
copy from PKG-INFO
copy to parallax.egg-info/PKG-INFO
index a9885d4..b45ff60 100644
--- a/PKG-INFO
+++ b/parallax.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: parallax
-Version: 1.0.1
+Version: 1.0.2
 Summary: Execute commands and copy files over SSH to multiple machines at once
 Home-page: https://github.com/krig/parallax/
 Author: Kristoffer Gronlund
diff --git a/parallax.egg-info/SOURCES.txt b/parallax.egg-info/SOURCES.txt
new file mode 100644
index 0000000..0650cc7
--- /dev/null
+++ b/parallax.egg-info/SOURCES.txt
@@ -0,0 +1,21 @@
+AUTHORS
+COPYING
+MANIFEST.in
+README
+README.md
+setup.py
+bin/parallax-askpass
+parallax/__init__.py
+parallax/askpass_client.py
+parallax/askpass_server.py
+parallax/callbacks.py
+parallax/color.py
+parallax/manager.py
+parallax/psshutil.py
+parallax/task.py
+parallax/version.py
+parallax.egg-info/PKG-INFO
+parallax.egg-info/SOURCES.txt
+parallax.egg-info/dependency_links.txt
+parallax.egg-info/top_level.txt
+test/test_api.py
\ No newline at end of file
diff --git a/parallax.egg-info/dependency_links.txt b/parallax.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/parallax.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/parallax.egg-info/top_level.txt b/parallax.egg-info/top_level.txt
new file mode 100644
index 0000000..4c7c9ef
--- /dev/null
+++ b/parallax.egg-info/top_level.txt
@@ -0,0 +1 @@
+parallax
diff --git a/parallax/__init__.py b/parallax/__init__.py
index 8b9add8..d4c368c 100644
--- a/parallax/__init__.py
+++ b/parallax/__init__.py
@@ -172,8 +172,8 @@ def call(hosts, cmdline, opts=Options()):
         manager.add_task(t)
     try:
         return manager.run()
-    except FatalError:
-        sys.exit(1)
+    except FatalError as err:
+        raise IOError(str(err))
 
 
 class _CopyOutputBuilder(object):
@@ -246,8 +246,8 @@ def copy(hosts, src, dst, opts=Options()):
         manager.add_task(t)
     try:
         return manager.run()
-    except FatalError:
-        sys.exit(1)
+    except FatalError as err:
+        raise IOError(str(err))
 
 
 class _SlurpOutputBuilder(object):
@@ -343,5 +343,5 @@ def slurp(hosts, src, dst, opts=Options()):
         manager.add_task(t)
     try:
         return manager.run()
-    except FatalError:
-        sys.exit(1)
+    except FatalError as err:
+        raise IOError(str(err))
diff --git a/parallax/manager.py b/parallax/manager.py
index ed58d5d..153a369 100644
--- a/parallax/manager.py
+++ b/parallax/manager.py
@@ -8,6 +8,7 @@ import signal
 import sys
 import threading
 import copy
+import fcntl
 
 try:
     import queue
@@ -247,6 +248,7 @@ class IOMap(object):
 
         # Setup the wakeup file descriptor to avoid hanging on lost signals.
         wakeup_readfd, wakeup_writefd = os.pipe()
+        fcntl.fcntl(wakeup_writefd, fcntl.F_SETFL, os.O_NONBLOCK)
         self.register_read(wakeup_readfd, self.wakeup_handler)
         # TODO: remove test when we stop supporting Python <2.5
         if hasattr(signal, 'set_wakeup_fd'):
diff --git a/parallax/version.py b/parallax/version.py
index 1dea037..6732d5a 100644
--- a/parallax/version.py
+++ b/parallax/version.py
@@ -1 +1 @@
-VERSION = '1.0.1'
+VERSION = '1.0.2'
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..8bfd5a1
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,4 @@
+[egg_info]
+tag_build = 
+tag_date = 0
+
diff --git a/setup.py b/setup.py
index 7e8d983..be8923b 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,4 @@
-from distutils.core import setup
+from setuptools import setup
 from parallax import version
 
 long_description = """Parallax SSH provides an interface to executing commands on multiple
diff --git a/test/test_api.py b/test/test_api.py
index b291468..9f03210 100644
--- a/test/test_api.py
+++ b/test/test_api.py
@@ -11,7 +11,7 @@ import shutil
 basedir, bin = os.path.split(os.path.dirname(os.path.abspath(sys.argv[0])))
 sys.path.insert(0, "%s" % basedir)
 
-print basedir
+print(basedir)
 
 import parallax as para
 
@@ -28,7 +28,7 @@ class CallTest(unittest.TestCase):
     def testSimpleCall(self):
         opts = para.Options()
         opts.default_user = g_user
-        for host, result in para.call(g_hosts, "ls -l /", opts).iteritems():
+        for host, result in para.call(g_hosts, "ls -l /", opts).items():
             if isinstance(result, para.Error):
                 raise result
             rc, out, err = result
@@ -38,17 +38,17 @@ class CallTest(unittest.TestCase):
     def testUptime(self):
         opts = para.Options()
         opts.default_user = g_user
-        for host, result in para.call(g_hosts, "uptime", opts).iteritems():
+        for host, result in para.call(g_hosts, "uptime", opts).items():
             if isinstance(result, para.Error):
                 raise result
             rc, out, err = result
             self.assertEqual(rc, 0)
-            self.assert_(out.find("load average") != -1)
+            self.assert_(out.decode("utf8").find("load average") != -1)
 
     def testFailingCall(self):
         opts = para.Options()
         opts.default_user = g_user
-        for host, result in para.call(g_hosts, "touch /foofoo/barbar/jfikjfdj", opts).iteritems():
+        for host, result in para.call(g_hosts, "touch /foofoo/barbar/jfikjfdj", opts).items():
             self.assert_(isinstance(result, para.Error))
             self.assert_(str(result).find('with error code') != -1)
 
@@ -65,14 +65,14 @@ class CopySlurpTest(unittest.TestCase):
         opts.default_user = g_user
         opts.localdir = self.tmpDir
         by_host = para.copy(g_hosts, "/etc/hosts", "/tmp/para.test", opts)
-        for host, result in by_host.iteritems():
+        for host, result in by_host.items():
             if isinstance(result, para.Error):
                 raise result
             rc, _, _ = result
             self.assertEqual(rc, 0)
 
         by_host = para.slurp(g_hosts, "/tmp/para.test", "para.test", opts)
-        for host, result in by_host.iteritems():
+        for host, result in by_host.items():
             if isinstance(result, para.Error):
                 raise result
             rc, _, _, path = result
@@ -83,4 +83,6 @@ if __name__ == '__main__':
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(CallTest, "test"))
     suite.addTest(unittest.makeSuite(CopySlurpTest, "test"))
-    unittest.TextTestRunner().run(suite)
+    result = unittest.TextTestRunner().run(suite)
+    if not result.wasSuccessful():
+        sys.exit(1)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/parallax.git



More information about the Python-modules-commits mailing list