Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vppctl: Do not use sudo if already root
[vpp.git]
/
vpp-api-test
/
scripts
/
vppctl
diff --git
a/vpp-api-test/scripts/vppctl
b/vpp-api-test/scripts/vppctl
index
160bdf7
..
6dfa3b9
100755
(executable)
--- a/
vpp-api-test/scripts/vppctl
+++ b/
vpp-api-test/scripts/vppctl
@@
-42,8
+42,12
@@
class Vppctl(Cmd):
input_command = input_prefix + line
line_remove = '^load_one_plugin:'
s = '\n'
input_command = input_prefix + line
line_remove = '^load_one_plugin:'
s = '\n'
+ command = ['vpp_api_test']
- vpp_process = subprocess.Popen(['sudo', 'vpp_api_test'],
+ if os.geteuid() != 0:
+ command = ['sudo', 'vpp_api_test']
+
+ vpp_process = subprocess.Popen(command,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)