This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

pypsh is a simple commandline tool to execute a command in parallel on multiple hosts.

Under the hoods it uses ssh via the paramiko python library.

Why pypsh instead of dsh?

Because managing group files with dsh is tedious. Pypsh requires no configuration, it just works.

Similar to dsh, pypsh can be used to execute a command on multiple hosts in parallel. In addition it is also possible to copy a file to multiple hosts at once. See below for further usage instructions.

The command or file copy operation will be executed on any host that is in the known_hosts file and matches the given regular expression.

This means in order for pypsh to know about a host it is necessary to connect to it at least once with plain ssh.

Command Execution

To execute a command on a group of hosts matching a given regular expression:

pypsh <hostregex> <cmd-to-execute>

E.g.:

pypsh "role\d+\.customer\.your\.domain" "uptime"

Instead of executing the commands in parallel it is also possible to execute the commands one after another. To do so use:

pypsh "role\d+\.customer\.your\.domain" --interval 0.1 cmd "uptime"

Or to wait between the commands (which might be useful when restarting services like elasticsearch that are part of a cluster):

pypsh "role\d+\.customer\.your\.domain" -i 60 cmd "uptime"

pypsh can also read from stdin. So it is possible to pipe command into it:

echo "uptime" | pypsh "myhosts[0-9]"

Note

Piping is only supported if pypsh itself only received one argument. Therefore it is not possible to couple it with other parameters like interval

Copy file to multiple hosts

To copy a given file to a group of hosts:

pypsh "my\.domains\d+\.com" copy /tmp/here/myfile.txt /tmp/remote/file.txt

Installation

pypsh can be installed using pip:

pip install pypsh

Development

To work on pypsh checkout the git repository, create a virtual environment and install the dependencies:

git clone https://github.com/mfussenegger/pypsh.git
cd pypsh
mkvirtualenv pypsh
pip install -r requirements.txt

Sometimes it is useful to point the pypsh command to the local development branch:

pip install --upgrade --force-reinstall --editable .

But usually it is sufficient to invoke it like this:

python pypsh/main.py ...
Release History

Release History

0.7.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.7.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.7.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.7.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.6.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pypsh-0.7.3.tar.gz (5.5 kB) Copy SHA256 Checksum SHA256 Source Jul 13, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting