autodeploy: check ok or true in on_start scripts
@@ -77,6 +77,7 @@ pub struct BuiltinsDeployer {
fn assert_ok(result: Vec<JValue>, err_msg: &str) -> eyre::Result<()> {
match &result[..] {
[JValue::String(s)] if s == "ok" => Ok(()),
+ [JValue::Bool(true)] => Ok(()),
_ => Err(eyre!(err_msg.to_string())),
}
}
@@ -232,7 +233,7 @@ impl BuiltinsDeployer {
(xor
(seq
(call relay ("dist" "add_module") [module_bytes module_config])
- (call %init_peer_id% ("op" "return") ["ok"])
+ (call %init_peer_id% ("op" "return") [true])
)
(call %init_peer_id% ("op" "return") [%last_error%.$.instruction])
)
@@ -256,7 +257,7 @@ impl BuiltinsDeployer {
(xor
(seq
(call relay ("srv" "remove") [name])
- (call %init_peer_id% ("op" "return") ["ok"])
+ (call %init_peer_id% ("op" "return") [true])
)
(call %init_peer_id% ("op" "return") [%last_error%.$.instruction])
)
@@ -279,7 +280,7 @@ impl BuiltinsDeployer {
(call relay ("srv" "create") [blueprint_id] service_id)
(seq
(call relay ("srv" "add_alias") [alias service_id] result)
- (call %init_peer_id% ("op" "return") ["ok"])
+ (call %init_peer_id% ("op" "return") [true])
)
)
)
@@ -322,7 +323,7 @@ impl BuiltinsDeployer {
(xor
(seq
(call relay ("script" "add") [script interval_sec])
- (call %init_peer_id% ("op" "return") ["ok"])
+ (call %init_peer_id% ("op" "return") [true])
)
(call %init_peer_id% ("op" "return") [%last_error%.$.instruction])
)
