summaryrefslogtreecommitdiffstats
path: root/patches/opnfv-fuel/0007-deploy-Allow-non-root-deploys.patch
blob: a7599e289dfc183d12275c98d0cadbc3a3b9e017 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Mon, 17 Jul 2017 23:10:25 +0000
Subject: [PATCH] deploy: Allow non-root deploys

Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
 ci/deploy.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ci/deploy.sh b/ci/deploy.sh
index 92c7947..edf05be 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -212,8 +212,8 @@ do
     esac
 done

-if [[ $EUID -ne 0 ]]; then
-    echo "This script must be run as root" 1>&2
+if [[ $(sudo whoami) != 'root' ]]; then
+    echo "This script requires sudo rights" 1>&2
     exit 1
 fi

@@ -230,9 +230,9 @@ pushd ${DEPLOY_DIR} > /dev/null
 # scenario, etc.

 # Install required packages
-[ -n "$(command -v apt-get)" ] && apt-get install -y mkisofs curl virtinst cpu-checker qemu-kvm vgabios && \
-  ln -sf /usr/share/vgabios/vgabios.bin /usr/share/qemu/vgabios-stdvga.bin
-[ -n "$(command -v yum)" ] && yum install -y genisoimage curl virt-install qemu-kvm vgabios
+[ -n "$(command -v apt-get)" ] && sudo apt-get install -y mkisofs curl virtinst cpu-checker qemu-kvm vgabios && \
+  sudo ln -sf /usr/share/vgabios/vgabios.bin /usr/share/qemu/vgabios-stdvga.bin
+[ -n "$(command -v yum)" ] && sudo yum install -y genisoimage curl virt-install qemu-kvm vgabios

 # Check scenario file existence
 if [[ ! -f  ../config/${DEPLOY_SCENARIO}.yaml ]]; then