Skip to content

Instantly share code, notes, and snippets.

@tbatchelli
Last active December 17, 2015 05:38
Show Gist options
  • Save tbatchelli/5558723 to your computer and use it in GitHub Desktop.
Save tbatchelli/5558723 to your computer and use it in GitHub Desktop.
session-results> (pprint (run))
{:phase-errors true,
:phase :second,
:results
({:errors
({:error
{:server "192.168.56.101",
:type :pallet-script-excution-error,
:message "192.168.56.101 Error executing script",
:exit 255,
:out "fail! (NO_SOURCE_PATH:23)...\n"},
:script
"#!/usr/bin/env bash\necho 'fail! (NO_SOURCE_PATH:23)...';\n{\n # NO_SOURCE_PATH:25\nexit -1\n } || { echo '#> fail! (NO_SOURCE_PATH:23) : FAIL'; exit 1;} >&2 \necho '#> fail! (NO_SOURCE_PATH:23) : SUCCESS'\n\nexit $?",
:flag-values {},
:flags #{},
:out "fail! (NO_SOURCE_PATH:23)...\n",
:exit 255}),
:target
{:count 2,
:group-name :bad,
:image {:image-id :ubuntu-12.04},
:phases
{:bootstrap #< clojure.lang.AFunction$1@323522e>,
:second
#<session_results$fn__43814 session_results$fn__43814@7bc7413>},
:group-names #{:bad},
:node bad-1 bad public: 192.168.56.101},
:target-type nil,
:plan-state
{:node-values
{nv46789
{:error
{:server
"192.168.56.101",
:type :pallet-script-excution-error,
:message "192.168.56.101 Error executing script",
:exit 255,
:out "fail! (NO_SOURCE_PATH:23)...\n"},
:script
"#!/usr/bin/env bash\necho 'fail! (NO_SOURCE_PATH:23)...';\n{\n # NO_SOURCE_PATH:25\nexit -1\n } || { echo '#> fail! (NO_SOURCE_PATH:23) : FAIL'; exit 1;} >&2 \necho '#> fail! (NO_SOURCE_PATH:23) : SUCCESS'\n\nexit $?",
:flag-values {},
:flags #{},
:out "fail! (NO_SOURCE_PATH:23)...\n",
:exit 255},
nv46788
{:script
"#!/usr/bin/env bash\nhello\n # NO_SOURCE_PATH:22\necho hello world!\n\nexit $?",
:flag-values {},
:flags #{},
:out
"pallet04LsR: line 2: hello: command not found\nhello world!\n",
:exit 0},
nv46770
{:script
"#!/usr/bin/env bash\nfirst\n # NO_SOURCE_PATH:8\necho first!\n\nexit $?",
:flag-values {},
:flags #{},
:out "palletgvVOQ: line 2: first: command not found\nfirst!\n",
:exit 0
},
nv46773
{:script
"#!/usr/bin/env bash\nfirst\n # NO_SOURCE_PATH:8\necho first!\n\nexit $?",
:flag-values {},
:flags #{},
:out "palletQRWkk: line 2: first: command not found\nfirst!\n",
:exit 0}}},
:result
({:script
"#!/usr/bin/env bash\nhello\n # NO_SOURCE_PATH:22\necho hello world!\n\nexit $?",
:flag-values {},
:flags #{},
:out
"pallet04LsR: line 2: hello: command not found\nhello world!\n",
:exit 0}
{:error
{:server "192.168.56.101",
:type :pallet-script-excution-error,
:message "192.168.56.101 Error executing script",
:exit 255,
:out "fail! (NO_SOURCE_PATH:23)...\n"},
:script
"#!/usr/bin/env bash\necho 'fail! (NO_SOURCE_PATH:23)...';\n{\n # NO_SOURCE_PATH:25\nexit -1\n } || { echo '#> fail! (NO_SOURCE_PATH:23) : FAIL'; exit 1;} >&2 \necho '#> fail! (NO_SOURCE_PATH:23) : SUCCESS'\n\nexit $?",
:flag-values {},
:flags #{},
:out "fail! (NO_SOURCE_PATH:23)...\n",
:exit 255}),
:phase :second}
{:errors
({:error
{:server "192.168.56.104",
:type :pallet-script-excution-error,
:message "192.168.56.104 Error executing script",
:exit 255,
:out "fail! (NO_SOURCE_PATH:23)...\n"},
:script
"#!/usr/bin/env bash\necho 'fail! (NO_SOURCE_PATH:23)...';\n{\n # NO_SOURCE_PATH:25\nexit -1\n } || { echo '#> fail! (NO_SOURCE_PATH:23) : FAIL'; exit 1;} >&2 \necho '#> fail! (NO_SOURCE_PATH:23) : SUCCESS'\n\nexit $?",
:flag-values {},
:flags #{},
:out "fail! (NO_SOURCE_PATH:23)...\n",
:exit 255}),
:target
{:count 2,
:group-name :bad,
:image {:image-id :ubuntu-12.04},
:phases
{:bootstrap #< clojure.lang.AFunction$1@323522e>,
:second
#<session_results$fn__43814 session_results$fn__43814@7bc7413>},
:group-names #{:bad},
:node bad-0 bad public: 192.168.56.104},
:target-type nil,
:plan-state
{:node-values
{nv46785
{:error
{:server "192.168.56.
104",
:type :pallet-script-excution-error,
:message "192.168.56.104 Error executing script",
:exit 255,
:out "fail! (NO_SOURCE_PATH:23)...\n"},
:script
"#!/usr/bin/env bash\necho 'fail! (NO_SOURCE_PATH:23)...';\n{\n # NO_SOURCE_PATH:25\nexit -1\n } || { echo '#> fail! (NO_SOURCE_PATH:23) : FAIL'; exit 1;} >&2 \necho '#> fail! (NO_SOURCE_PATH:23) : SUCCESS'\n\nexit $?",
:flag-values {},
:flags #{},
:out "fail! (NO_SOURCE_PATH:23)...\n",
:exit 255},
nv46784
{:script
"#!/usr/bin/env bash\nhello\n # NO_SOURCE_PATH:22\necho hello world!\n\nexit $?",
:flag-values {},
:flags #{},
:out
"palletu1fp0: line 2: hello: command not found\nhello world!\n",
:exit 0},
nv46770
{:script
"#!/usr/bin/env bash\nfirst\n # NO_SOURCE_PATH:8\necho first!\n\nexit $?",
:flag-values {},
:flags #{},
:out "palletgvVOQ: line 2: first: command not found\nfirst!\n",
:exit 0},
nv46773
{:script
"#!/usr/bin/env bash\nfirst\n # NO_SOURCE_PATH:8\necho first!\n\nexit $?",
:flag-values {},
:flags #{},
:out "palletQRWkk: line 2: first: command not found\nfirst!\n",
:exit 0}}},
:result
({:script
"#!/usr/bin/env bash\nhello\n # NO_SOURCE_PATH:22\necho hello world!\n\nexit $?",
:flag-values {},
:flags #{},
:out
"palletu1fp0: line 2: hello: command not found\nhello world!\n",
:exit 0}
{:error
{:server "192.168.56.104",
:type :pallet-script-excution-error,
:message "192.168.56.104 Error executing script",
:exit 255,
:out "fail! (NO_SOURCE_PATH:23)...\n"},
:script
"#!/usr/bin/env bash\necho 'fail! (NO_SOURCE_PATH:23)...';\n{\n # NO_SOURCE_PATH:25\nexit -1\n } || { echo '#> fail! (NO_SOURCE_PATH:23) : FAIL'; exit 1;} >&2 \necho '#> fail! (NO_SOURCE_PATH:23) : SUCCESS'\n\nexit $?",
:flag-values {},
:flags #{},
:out "fail! (NO_SOURCE_PATH:23)...\n",
:exit 255}),
:phase :second}
{:target
{:count 2,
:group-name :good,
:image {:image-id :ubuntu-12.04},
:phases
{:bootstrap #< clojure.lang.AFunction$1@273881ae>,
:first
#<session_results$fn__43758 session_results$fn__43758@630358c>,
:second
#<session_results$fn__43785 session_results$fn__43785@435c82f0>},
:group-names #{:good},
:node good-1 good public: 192.168.56.102},
:target-type nil,
:plan-state
{:node-values
{nv46781
{:script
"#!/usr/bin/env bash\necho 'say hello! (NO_SOURCE_PATH:10)...';\n{\n # NO_SOURCE_PATH:12\necho hello world!\n } || { echo '#> say hello! (NO_SOURCE_PATH:10) : FAIL'; exit 1;} >&2 \necho '#> say hello! (NO_SOURCE_PATH:10) : SUCCESS'\n\nexit $?",
:flag-values {},
:flags #{},
:out
"say hello! (NO_SOURCE_PATH:10)...\nhello world!\n#> say hello! (NO_SOURCE_PATH:10) : SUCCESS\n",
:exit 0},
nv46770
{:script
"#!/usr/bin/env bash\nfirst\n # NO_SOURCE_PATH:8\necho
first!\n\nexit $?",
:flag-values {},
:flags #{},
:out "palletgvVOQ: line 2: first: command not found\nfirst!\n",
:exit 0},
nv46773
{:script
"#!/usr/bin/env bash\nfirst\n # NO_SOURCE_PATH:8\necho first!\n\nexit $?",
:flag-values {},
:flags #{},
:out "palletQRWkk: line 2: first: command not found\nfirst!\n",
:exit 0}}},
:result
({:script
"#!/usr/bin/env bash\necho 'say hello! (NO_SOURCE_PATH:10)...';\n{\n # NO_SOURCE_PATH:12\necho hello world!\n } || { echo '#> say hello! (NO_SOURCE_PATH:10) : FAIL'; exit 1;} >&2 \necho '#> say hello! (NO_SOURCE_PATH:10) : SUCCESS'\n\nexit $?",
:flag-values {},
:flags #{},
:out
"say hello! (NO_SOURCE_PATH:10)...\nhello world!\n#> say hello! (NO_SOURCE_PATH:10) : SUCCESS\n",
:exit 0}),
:phase :second}
{:target
{:count 2,
:group-name :good,
:image {:image-id :ubuntu-12.04},
:phases
{:bootstrap #< clojure.lang.AFunction$1@273881ae>,
:first
#<
session_results$fn__43758 session_results$fn__43758@630358c>,
:second
#<session_results$fn__43785 session_results$fn__43785@435c82f0>},
:group-names #{:good},
:node good-0 good public: 192.168.56.103},
:target-type nil,
:plan-state
{:node-values
{nv46792
{:script
"#!/usr/bin/env bash\necho 'say hello! (NO_SOURCE_PATH:10)...';\n{\n # NO_SOURCE_PATH:12\necho hello world!\n } || { echo '#> say hello! (NO_SOURCE_PATH:10) : FAIL'; exit 1;} >&2 \necho '#> say hello! (NO_SOURCE_PATH:10) : SUCCESS'\n\nexit $?",
:flag-values {},
:flags #{},
:out
"say hello! (NO_SOURCE_PATH:10)...\nhello world!\n#> say hello! (NO_SOURCE_PATH:10) : SUCCESS\n",
:exit 0},
nv46770
{:script
"#!/usr/bin/env bash\nfirst\n # NO_SOURCE_PATH:8\necho first!\n\nexit $?",
:flag-values {},
:flags #{},
:out "palletgvVOQ: line 2: first: command not found\nfirst!\n",
:exit 0},
nv46773
{:script
"#!/usr
/bin/env bash\nfirst\n # NO_SOURCE_PATH:8\necho first!\n\nexit $?",
:flag-values {},
:flags #{},
:out "palletQRWkk: line 2: first: command not found\nfirst!\n",
:exit 0}}},
:result
({:script
"#!/usr/bin/env bash\necho 'say hello! (NO_SOURCE_PATH:10)...';\n{\n # NO_SOURCE_PATH:12\necho hello world!\n } || { echo '#> say hello! (NO_SOURCE_PATH:10) : FAIL'; exit 1;} >&2 \necho '#> say hello! (NO_SOURCE_PATH:10) : SUCCESS'\n\nexit $?",
:flag-values {},
:flags #{},
:out
"say hello! (NO_SOURCE_PATH:10)...\nhello world!\n#> say hello! (NO_SOURCE_PATH:10) : SUCCESS\n",
:exit 0}),
:phase :second})}
nil
session-results>
(learn-pallet/bootstrap-ns session-results nil)
(ns session-results
(:require [pallet.actions :as actions]
[pallet.api :as api]))
(def good-group
(api/group-spec
"good"
:extends *base-spec*
:phases
{:first (api/plan-fn (actions/exec-script
"first"
(println "first!")))
:second (api/plan-fn
(actions/exec-checked-script
"say hello!"
("echo" "hello world!")))}))
(def bad-group
(api/group-spec
"bad"
:extends *base-spec*
:phases
{:second (api/plan-fn
(actions/exec-script
"hello"
(println "hello world!"))
(actions/exec-checked-script
"fail!"
("exit -1")))}))
(defn run
([] (run 2 2))
([n] (run n 2))
([n m]
(api/converge {good-group n
bad-group m}
:compute *compute*
:phase [:first :second])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment