-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnodeman_list.bash
70 lines (62 loc) · 1.08 KB
/
nodeman_list.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 2025, Battelle Energy Alliance, LLC
#
# Author:
# Scott Serr
#
# Description:
# Functions having to do with processing host lists
nm.clean () {
awk '{ print $1 }' | sed 's/://'
}
nm.split () {
while read line; do
for h in $line; do
echo $h
done
done
}
nm.cluset () {
cluset -e -S "\n" $*
}
nm.nodes () {
nm.cluset @compute
}
nm.waitsec () {
single () {
# sleep $1
echo $1
}
export -f single
nm._parallel -j0 --line-buffer --delay $1 single
}
nm.wait () {
single () {
sleep 2 # let system settle if we just shut it down
nm._log "$1 nm.wait start"
while ! (ssh $1 uptime < /dev/null &> /dev/null); do
nm._log "$1 nm.wait loop"
sleep 10
done
nm._log "$1 nm.wait complete"
echo $1
}
export -f single
nm._parallel -j0 --timeout 15m single
}
nm.slow () {
if [[ "$1" == "" ]]; then
D=1
else
D=$1
fi
nm._parallel -j10 --delay $D --line-buffer echo
}
nm.list.remove () {
RLIST="$*"
while read LINE; do
if ! grep -q "$LINE" <<< "$RLIST"; then
echo $LINE
fi
done
}