18785: avoid error when /etc/cloud/cloud.cfg.d does not exist.
authorWard Vandewege <ward@curii.com>
Tue, 1 Mar 2022 21:57:07 +0000 (16:57 -0500)
committerWard Vandewege <ward@curii.com>
Wed, 2 Mar 2022 01:12:10 +0000 (20:12 -0500)
Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

tools/salt-install/provision.sh

index f467c77e78f3545b66314f758abdf3c193ac33e4..644b87cbbf9c254eaf4c9782b7def1c47a565c4a 100755 (executable)
@@ -784,8 +784,10 @@ echo '\pset pager off' >> /root/.psqlrc
 salt-call --local state.apply -l ${LOG_LEVEL}
 
 # Finally, make sure that /etc/hosts is not overwritten on reboot
-# TODO: will this work on CentOS?
-sed -i 's/^manage_etc_hosts: true/#manage_etc_hosts: true/g' /etc/cloud/cloud.cfg.d/*
+if [ -d /etc/cloud/cloud.cfg.d ]; then
+  # TODO: will this work on CentOS?
+  sed -i 's/^manage_etc_hosts: true/#manage_etc_hosts: true/g' /etc/cloud/cloud.cfg.d/*
+fi
 
 # FIXME! #16992 Temporary fix for psql call in arvados-api-server
 if [ "x${DELETE_PSQL}" = "xyes" ]; then