mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-12-03 11:24:55 +01:00
better output and examples
This commit is contained in:
parent
aa58657122
commit
04052b6193
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "Bash actor called with $@"
|
||||
echo "Bash actor called with $@" > /tmp/act
|
||||
echo "Bash actor called with: $@"
|
||||
|
@ -1,13 +1,14 @@
|
||||
-- { actor_connections = [] : List { _1 : Text, _2 : Text }
|
||||
{ actor_connections =
|
||||
-- Link up machines to actors
|
||||
[ { _1 = "Testmachine", _2 = "Actor" }
|
||||
, { _1 = "Another", _2 = "Bash" }
|
||||
-- One machine can have as many actors as it wants
|
||||
, { _1 = "Yetmore", _2 = "Bash2" }
|
||||
, { _1 = "Yetmore", _2 = "FailBash"}
|
||||
]
|
||||
, actors =
|
||||
{ Actor = { module = "Dummy", params = {=} }
|
||||
, Actor2 = { module = "Dummy", params = {=} }
|
||||
, Actor3 = { module = "Dummy", params = {=} }
|
||||
, Bash = { module = "Process", params =
|
||||
{ cmd = "./examples/actor.sh"
|
||||
, args = "your ad could be here"
|
||||
@ -16,8 +17,8 @@
|
||||
{ cmd = "./examples/actor.sh"
|
||||
, args = "this is a different one"
|
||||
}}
|
||||
, Bash3 = { module = "Process", params =
|
||||
{ cmd = "./examples/actor.sh"
|
||||
, FailBash = { module = "Process", params =
|
||||
{ cmd = "./examples/fail-actor.sh"
|
||||
}}
|
||||
}
|
||||
, init_connections = [] : List { _1 : Text, _2 : Text }
|
||||
|
4
examples/fail-actor.sh
Executable file
4
examples/fail-actor.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "This is some error output" > /dev/stderr
|
||||
exit 115
|
@ -78,7 +78,7 @@ impl Actuator for Process {
|
||||
}
|
||||
}
|
||||
Ok(retv) => {
|
||||
warn!(flog, "Actor {} returned nonzero output {} for {:?}", name, retv.status, fstate);
|
||||
warn!(flog, "Actor {} returned nonzero status {} for State={:?}", name, retv.status, fstate);
|
||||
if !retv.stderr.is_empty() {
|
||||
let errstr = String::from_utf8_lossy(&retv.stderr);
|
||||
for line in errstr.lines() {
|
||||
|
Loading…
Reference in New Issue
Block a user