Skip to main content

A process remote launcher.

Project description

Build Status Coverage Status

yassh

This project contains a python library used to run asynchronous and dependent ssh tasks.

Usage

from yassh import *

r = Reactor()
c1 = Command('cmd1', r, 'localhost', 'user', 'sleep 5')
c2 = Command('cmd2', r, 'localhost', 'user', 'echo ok')
c3 = Command('cmd3', r, 'localhost', 'user', 'echo "finished" && sleep 1')

# Start cmd2 when cmd1 complete
def on_c1_exit(): c2.start()
c1.register_exit_monitor(on_c1_exit)

# Start cmd3 when cmd2 complete
def on_c2_ok(): c3.start()
c2.register_monitor('ok', on_c2_ok)

# Stop reactor when cmd3 complete
def on_c3_exit(): r.stop()
c3.register_exit_monitor(on_c3_exit)
# Print dummy message when c3 is near terminaison
def on_c3_finished(): print 'c3 almost finished'
c3.register_monitor('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


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.1.0b2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

yassh-0.1.0b2-py2.py3-none-any.whl (9.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file yassh-0.1.0b2.tar.gz.

File metadata

  • Download URL: yassh-0.1.0b2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for yassh-0.1.0b2.tar.gz
Algorithm Hash digest
SHA256 b93c398865ec63e990a47926c5d99d2b278a91d854ac9efe1da3eeda139b00c4
MD5 d2b55f6365c4a69889793bdfe42ddf25
BLAKE2b-256 b8dfc9d40cffac02916c05f715b96ca4f1f84dcecb0951171129d24523414386

See more details on using hashes here.

File details

Details for the file yassh-0.1.0b2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for yassh-0.1.0b2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 39631f52f806ccd5727c44145fb81a45c600862cb6adea54d0fd9d13bf9db56b
MD5 52dfdc5456ca078521e1353bb5f7242a
BLAKE2b-256 41ff45439eeb638254218274ce65cd79bf2d66eeaa993bd566193c2f3c9a305f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page