cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [2/7] git commit: updated refs/heads/master to d7859ad
Date Fri, 27 Nov 2015 19:11:00 GMT
CLOUDSTACK-9077 Fix injectkeys.sh to work on CentOS7


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9b0b69d9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9b0b69d9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9b0b69d9

Branch: refs/heads/master
Commit: 9b0b69d9c8cb6bdc0232c7af0efcb45974f533d2
Parents: 3f7a86d
Author: Remi Bergsma <github@remi.nl>
Authored: Mon Nov 23 13:22:02 2015 +0100
Committer: Remi Bergsma <github@remi.nl>
Committed: Wed Nov 25 11:26:10 2015 +0100

----------------------------------------------------------------------
 scripts/vm/systemvm/injectkeys.sh | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9b0b69d9/scripts/vm/systemvm/injectkeys.sh
----------------------------------------------------------------------
diff --git a/scripts/vm/systemvm/injectkeys.sh b/scripts/vm/systemvm/injectkeys.sh
index f69e331..6f224cd 100755
--- a/scripts/vm/systemvm/injectkeys.sh
+++ b/scripts/vm/systemvm/injectkeys.sh
@@ -85,14 +85,19 @@ systemvmpath=$3
 
 command -v mkisofs > /dev/null   || (echo "$(basename $0): mkisofs not found, please install
or ensure PATH is accurate" ; exit 4)
 
-# if running into Docker as unprivileges, skip ssh verification as iso cannot be mounted.
-if [ -e /dev/loop0 ]; then
+# if running into Docker as unprivileges, skip ssh verification as iso cannot be mounted
due to missing loop device.
+if [ -f /.dockerinit ]; then
+  if [ -e /dev/loop0 ]; then
+    # it's a docker instance with privileges.
+    inject_into_iso systemvm.iso $newpubkey
+    [ $? -ne 0 ] && exit 5
+    copy_priv_key $newprivkey
+  else
+    # this mean it's a docker instance, ssh key cannot be verify.
+    echo "We run inside Docker, skipping ssh key insertion in systemvm.iso"
+  fi
+else
   inject_into_iso systemvm.iso $newpubkey
   [ $? -ne 0 ] && exit 5
   copy_priv_key $newprivkey
-else
-  # this mean it's a docker instance, ssh key cannot be verify.
-  echo "No loop device found, skipping ssh key insertion in systemvm.iso"
 fi
-
-exit $?


Mime
View raw message