|
120 | 120 | NON_WRITABLE=""
|
121 | 121 | # ensure all nodes are writable
|
122 | 122 | if [ "$CLUSTER" == "true" ] ; then
|
123 |
| - if [ -z "$GHE_FILE_SYSTEM_CHECK" ]; then |
| 123 | + if [ -z "$GHE_FILE_SYSTEM_WRITE_CHECK" ]; then |
124 | 124 | if [ -d "/data/user/tmp" ]; then
|
125 |
| - FILE_TO_TEST="/data/user/tmp/test-ro-file.txt" |
| 125 | + WRITE_CHECK_FILE="/data/user/tmp/test-ro-file.txt" |
126 | 126 | else
|
127 |
| - FILE_TO_TEST="/tmp/test-ro-file.txt" |
| 127 | + WRITE_CHECK_FILE="/tmp/test-ro-file.txt" |
128 | 128 | fi
|
129 | 129 | else
|
130 |
| - FILE_TO_TEST="$GHE_FILE_SYSTEM_CHECK/test-ro-file.txt" |
| 130 | + WRITE_CHECK_FILE="$GHE_FILE_SYSTEM_CHECK/test-ro-file.txt" |
131 | 131 | fi
|
132 | 132 |
|
133 | 133 | # Iterate through each node in the cluster
|
134 | 134 | nodes=$(ghe-ssh "$host" ghe-cluster-nodes)
|
135 | 135 | first=true
|
136 | 136 | for node in $nodes; do
|
137 |
| - if ! echo "set -o pipefail; ssh $node -- 'touch $FILE_TO_TEST && rm $FILE_TO_TEST'" | ghe-ssh "$host" /bin/bash; then |
| 137 | + if ! echo "set -o pipefail; ssh $node -- 'touch $WRITE_CHECK_FILE && rm $WRITE_CHECK_FILE'" | ghe-ssh "$host" /bin/bash; then |
138 | 138 | echo "File system is not writeable or no permission on $node" 1>&2
|
139 |
| - if [ "$first" = true ]; then |
140 |
| - NON_WRITABLE="$node" |
141 |
| - first=false |
142 |
| - else |
143 |
| - NON_WRITABLE="$NON_WRITABLE, $node" |
144 |
| - fi |
| 139 | + NON_WRITABLE+="$node " |
145 | 140 | fi || true
|
146 | 141 | done
|
147 | 142 | # Display the comma-separated list of non-writable nodes
|
148 |
| - if [ ! -z "$NON_WRITABLE" ]; then |
| 143 | + if [ -n "$NON_WRITABLE" ]; then |
| 144 | + NON_WRITABLE=$(echo "$NON_WRITABLE" | sed 's/ /, /g; s/, $//') |
149 | 145 | log_error "Error: Following nodes are non-writable - $NON_WRITABLE. Please make sure the filesystem for all GHES nodes are writable." 1>&2
|
150 | 146 | exit 1
|
151 | 147 | else
|
152 |
| - echo "All nodes are writable." |
| 148 | + log_info "All nodes are writable." |
153 | 149 | fi
|
154 | 150 | fi
|
155 | 151 |
|
|
0 commit comments