aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Bjurel <jonas.bjurel@ericsson.com>2016-03-11 13:04:55 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-03-11 13:04:55 +0000
commit0818c884dbaedc3543156790ca2d9e7b1a6328f6 (patch)
treeb7f5f7b9f3a8885010525a55446f15bf07ec91af
parent26705adaa343fdbef2440a35b438808ac34fded4 (diff)
parentbefc84a9d28663a45510c71119980e1cf5b6eeca (diff)
Merge "Get user id without forking a shell."
-rw-r--r--deploy/common.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/deploy/common.py b/deploy/common.py
index cc418b59b..787a21a1d 100644
--- a/deploy/common.py
+++ b/deploy/common.py
@@ -133,8 +133,8 @@ def commafy(comma_separated_list):
def check_if_root():
- r = exec_cmd('whoami')
- if r != 'root':
+ uid = os.getuid()
+ if uid != 0:
err('You need be root to run this application')