Merge "Run glean fewer times in glean.sh"

This commit is contained in:
Zuul 2021-03-22 02:16:59 +00:00 committed by Gerrit Code Review
commit 4bfbbba06f
1 changed files with 9 additions and 5 deletions

View File

@ -29,8 +29,12 @@ elif blkid -t LABEL="CONFIG-2" ; then
CONFIG_DRIVE_LABEL="CONFIG-2" CONFIG_DRIVE_LABEL="CONFIG-2"
fi fi
# Test to see if config-drive exists. If not, skip and assume DHCP networking # If the config drive exists we update the ssh keys, hostname and network
# will work because sanity # interfaces. Otherwise we only update network interfaces with a dhcp
# fallback.
#
# Note we want to run as few glean processes as possible to cut down on
# runtime in resource constrained environments.
if [ -n "$CONFIG_DRIVE_LABEL" ]; then if [ -n "$CONFIG_DRIVE_LABEL" ]; then
# Mount config drive # Mount config drive
mkdir -p /mnt/config mkdir -p /mnt/config
@ -43,7 +47,7 @@ if [ -n "$CONFIG_DRIVE_LABEL" ]; then
else else
mount -o mode=0700 "${BLOCKDEV}" /mnt/config || true mount -o mode=0700 "${BLOCKDEV}" /mnt/config || true
fi fi
glean --ssh --skip-network --hostname glean --ssh --hostname $@
else
glean $@
fi fi
glean $@