Skip to content

Commit 5fc7e70

Browse files
Fix update of /etc/hosts files for clusters deployed in VPC without internet access.
1 parent 14828d7 commit 5fc7e70

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ aws-parallelcluster-cookbook CHANGELOG
33

44
This file is used to list changes made in each version of the AWS ParallelCluster cookbook.
55

6-
3.1.1
6+
3.1.2
7+
------
8+
9+
**BUG FIXES**
10+
- Fix update of `/etc/hosts` files for clusters deployed in VPC without internet access.
11+
12+
3.1.0
713
------
814

915
**ENHANCEMENTS**

cookbooks/aws-parallelcluster-slurm/files/default/head_node_slurm/prolog

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ _log() {
3636
_log "Adding nodes to /etc/hosts"
3737
# SLURM_NODE_ALIASES has value like "queue-0-dy-compute-resource-0-1:[192.168.1.2]:ip-192-168-1-2"
3838
# The following line transforms this line to "192.168.1.2 queue-0-dy-compute-resource ip-192-168-1-2"
39-
hosts=$(echo "${SLURM_NODE_ALIASES}" | awk 'BEGIN{RS=","; FS=":"}; {gsub(/\[|\]/,"",$2); print $2,$1,$3}')
40-
lines='#HOSTS_JOB_'"${SLURM_JOB_ID}\n${hosts}\n"'#END_JOB_'"${SLURM_JOB_ID}"
39+
hosts=$(echo -n "${SLURM_NODE_ALIASES}" | awk 'BEGIN{RS=","; FS=":";ORS="\\n"}; {gsub(/\[|\]/,"",$2); print $2,$1,$3}' )
40+
lines='#HOSTS_JOB_'"${SLURM_JOB_ID}\n${hosts}"'#END_JOB_'"${SLURM_JOB_ID}"
4141
if grep -q '^#HOSTS_JOB_.*' /etc/hosts
4242
then
4343
# If there is other nodes information in the file, the newest nodes information is inserted before the older ones.

0 commit comments

Comments
 (0)