diff --git a/scripts/vm/systemvm/injectkeys.sh b/scripts/vm/systemvm/injectkeys.sh index 9df1718253f2..6f006ea130ef 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 635b482d60a4..1d5b5821b467 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 @@ protected void injectSshKeysIntoSystemVmIsoPatch(String publicKeyPath, String pr 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); } }