A remote process launcher.
Project description
yassh
This project contains a python library used to run asynchronous and dependent ssh tasks.
Usage
import logging
from yassh import Reactor, RemoteRun, LocalRun
logging.basicConfig(level=logging.DEBUG)
r = Reactor()
c1 = RemoteRun(r, 'localhost', 'user', 'sleep 5')
c2 = LocalRun(r, 'echo ok')
c3 = RemoteRun(r, 'localhost', 'user', 'echo "finished" && sleep 1')
# Start cmd2 when cmd1 complete
def start_c2(): c2.start()
c1.register_exit_monitor(start_c2)
# Start cmd3 when cmd2 complete
def start_c3(): c3.start()
c2.register_monitor(u'ok', start_c3)
# Print dummy message when c3 is near terminaison
def on_c3_finished(): print 'c3 almost finished'
c3.register_monitor(u'finished', on_c3_finished)
# Start first task
c1.start()
timeout = -1
while r.run(timeout) > 0:
pass
Installation
To install latest release:
pip install yassh
To install latest code:
pip install git+https://github.com/Enyx-SA/yassh.git
Testing
Run from project root:
behave
License
MIT License (see LICENSE)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yassh-0.5.7.tar.gz
(5.7 kB
view details)
Built Distribution
yassh-0.5.7-py2.py3-none-any.whl
(13.4 kB
view details)
File details
Details for the file yassh-0.5.7.tar.gz
.
File metadata
- Download URL: yassh-0.5.7.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8317e365c2e8f5509bfb5a5ab0b351f76511195a97e83909f66aa5940cc2980 |
|
MD5 | c6d69cbf1556a56fcf96634b85c66cdf |
|
BLAKE2b-256 | 29fc965a0edf2bfbe6b8120ca84acc8d24daf784822ded14e8625da9779a2bfa |
File details
Details for the file yassh-0.5.7-py2.py3-none-any.whl
.
File metadata
- Download URL: yassh-0.5.7-py2.py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4d1b13c90bb03d83980a7c4d4db823d0e73ade45d1dbe1d51b3d5a873d6c664 |
|
MD5 | 82049df71a952b0f700de5822e1cb7f1 |
|
BLAKE2b-256 | be98b7f10ac898651a7d9690e82b363d866d185b1af281c872ece1f4e1a412b8 |