Wait For Output
Waits for a pattern to match output of a command or docker container logs.
Features:
- Waiting for a pattern to appear in docker container logs
- Waiting for a generic command output to appear
- Finding container name by regexp pattern
- Returns result as a exit code and message
- Output of checked command/container log is passed through to the console
Installing
pip install waitforoutput
Usage with docker
--container takes a regexp expression, or a full container name. Output from container is streamed to the console until timeout is reached, at the end
only result is displayed - the container is not killed.
If multiple containers are found the application will exit with an error.
$ waitforoutput 'Configuration complete; ready for start up' --container 'nginx_*' --timeout 5
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
[2021-05-14 05:01:46.188][info]: Match found
Usage with any shell command
Command specified with --command parameter will be launched, and the waitforoutput will be streaming output until the --timeout is reached.
After timeout the process will be killed.
$ waitforoutput 'Linux' --command 'uname -a'
Linux riotkit-dev 5.10.23-1-MANJARO #1 SMP PREEMPT Thu Mar 11 18:47:18 UTC 2021 x86_64 GNU/Linux
[2021-05-14 05:01:46.188][info]: Match found
Authors
Created by Riotkit anarchist tech-collective.
Metadata
Release files for waitforoutput 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| waitforoutput-1.0.1.tar.gz | 9.3 kB | Without provenance | Details for waitforoutput-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| waitforoutput-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for waitforoutput-1.0.1-py3-none-any.whl |
Total release size: 18.6 kB
Release files / waitforoutput-1.0.1.tar.gz
| Download URL | waitforoutput-1.0.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd94d8dccea5b0799fbe9c0b14813e6d6bb06aa2381d52821c9cf4af028249ec
|
|
BLAKE2b-256 checksum How to use checksums |
a46f60c0076c5370a5e8e873424e62fed22283f3beafab5b969dfe8066246752
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10
|
Release files / waitforoutput-1.0.1-py3-none-any.whl
| Download URL | waitforoutput-1.0.1-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e83ee49fec71c64c5a3be1464b81fac44ee90dcc555486b53bd6fce993341961
|
|
BLAKE2b-256 checksum How to use checksums |
23bb107e4195b50ee84d6448e28ed1221937983c223a573cfe682a1db4bf02f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10
|
Security for waitforoutput 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.