Skip to content

Commit cfcf893

Browse files
Merge pull request #2220 from craigcomstock/ent-14028/master
ent-14028: fix known_hosts issues with exotics
2 parents dbc2839 + 9ca64be commit cfcf893

1 file changed

Lines changed: 3 additions & 23 deletions

File tree

‎ci/initialize-build-host.sh‎

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
# 2. If $(pwd)/proxy-target.txt exists, it means this is a proxy host, and the
1212
# real build machine is on the host specified by the login details inside
1313
# that file. If the file does not exist, we are on the build slave itself.
14-
# After figuring that stuff out, this script will run either on_proxy() or
15-
# the rest of the original script that sourced this file, depending on
14+
# After figuring that stuff out, the script will run the rest of the original
15+
# script that sources this file, depending on
1616
# whether we are on the proxy or build host, respectively. Note that commands
1717
# that are specified *before* this script is sourced will run on both hosts,
18-
# so make sure this is sourced early, but after on_proxy() is defined.
18+
# so make sure this is sourced early.
1919
#
2020
# The script is expected to be sourced early in the init-script phase after
2121
# provisioning.
@@ -275,15 +275,6 @@ reset_nested_vm() {
275275

276276
if [ -f $(pwd)/proxy-target.txt ]
277277
then
278-
ret=0
279-
on_proxy || ret=$?
280-
# Failure to find a function returns 127, so check for that specifically,
281-
# otherwise there was an error inside the function.
282-
if [ $ret -ne 0 -a $ret -ne 127 ]
283-
then
284-
exit $ret
285-
fi
286-
287278
# --------------------------------------------------------------------------
288279
# Check target machine health.
289280
# --------------------------------------------------------------------------
@@ -424,17 +415,6 @@ then
424415
exit $ret
425416
elif [ -z "$INIT_BUILD_HOST_SUB_INVOKATION" ]
426417
then
427-
# Add build-artifacts-cache to known hosts
428-
KNOWN_HOSTS_FILE=~/.ssh/known_hosts
429-
# if fgrep build-artifacts-cache.cloud.cfengine.com $KNOWN_HOSTS_FILE 2>/dev/null
430-
# then
431-
# :
432-
# else
433-
echo "build-artifacts-cache.cloud.cfengine.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6qcxCQgtubv9WEhrAyMEFFMLLEjirk0p0Ru+vATioEIyw7gBFfOWOp/dBfsF6fuiY1vt3IsBx4u1DkS4j8x7DjB8X2dIcBia2jt2D3sBdDFb/nc7ZnWfFf/E7dWoiF0WKvxZ62RwjyZuyz9TmL1d3jlIyuRimkhgwnuRAMyymJ5YbxvvfTH01OuGS/0pkqkLAxomRyJTv6qcGr1rOPd5FuySwOO5M/tGkajJppKC+8u/RCyWfgu1khrBmi6PevXTaoJ/lQyexexZK0HVsA5G1U/+ipO18DqaCCAnHvZ/AKt+yYmoe9RtLfx0T7DHinEV1yj4ynUj7EqudCrLOorg5 root@yoctobuild-sstate-cache" > $KNOWN_HOSTS_FILE
434-
# add openssl 3.x compatible host key as well
435-
echo "build-artifacts-cache.cloud.cfengine.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINMJKl282VQSz4EMMypJjATu21A9SxQA1XoTslIOID16 root@yoctobuild-sstate-cache" >> $KNOWN_HOSTS_FILE
436-
# fi
437-
438418
# Reexecute script in order to be able to collect the return code, and
439419
# potentially stop the slave.
440420
rsync -czt "$0" $HOME/commands.sh

0 commit comments

Comments
 (0)