From 9b7acfde1eb570f7524bf639f69106e0a7fe5800 Mon Sep 17 00:00:00 2001 From: Andrija Panic <45762285+andrijapanicsb@users.noreply.github.com> Date: Sat, 18 Jan 2020 09:11:42 +0100 Subject: [PATCH] Update message when keys are NOT being injected (#3799) * Update message when keys are NOT being injected * Correct the message after injectkeys.ssh is done * Update message to a more meaningful one, since sometimes nothing is injected * Update other 2 * typo --- scripts/vm/systemvm/injectkeys.sh | 2 +- .../main/java/com/cloud/server/ConfigurationServerImpl.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/vm/systemvm/injectkeys.sh b/scripts/vm/systemvm/injectkeys.sh index 9df1718253f..6f006ea130e 100755 --- a/scripts/vm/systemvm/injectkeys.sh +++ b/scripts/vm/systemvm/injectkeys.sh @@ -42,7 +42,7 @@ inject_into_iso() { [ ! -f $isofile ] && echo "$(basename $0): Could not find systemvm iso patch file $isofile" && return 1 $SUDO mount -o loop $isofile $MOUNTPATH [ $? -ne 0 ] && echo "$(basename $0): Failed to mount original iso $isofile" && clean_up && return 1 - diff -q $MOUNTPATH/authorized_keys $newpubkey &> /dev/null && clean_up && return 0 + diff -q $MOUNTPATH/authorized_keys $newpubkey &> /dev/null && echo "New public key is the same as the one in the systemvm.iso, not injecting it, not modifying systemvm.iso" && clean_up && return 0 $SUDO cp -b $isofile $backup [ $? -ne 0 ] && echo "$(basename $0): Failed to backup original iso $isofile" && clean_up && return 1 rm -rf $TMPDIR diff --git a/server/src/main/java/com/cloud/server/ConfigurationServerImpl.java b/server/src/main/java/com/cloud/server/ConfigurationServerImpl.java index 635b482d60a..1d5b5821b46 100644 --- a/server/src/main/java/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/main/java/com/cloud/server/ConfigurationServerImpl.java @@ -767,10 +767,10 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio command.add(systemVmIsoPath); final String result = command.execute(); - s_logger.info("Injected public and private keys into systemvm iso with result : " + result); + s_logger.info("The script injectkeys.sh was run with result : " + result); if (result != null) { - s_logger.warn("Failed to inject generated public key into systemvm iso " + result); - throw new CloudRuntimeException("Failed to inject generated public key into systemvm iso " + result); + s_logger.warn("The script injectkeys.sh failed to run successfully : " + result); + throw new CloudRuntimeException("The script injectkeys.sh failed to run successfully : " + result); } }