[Fuego] [PATCH 10/16] user_checks: add to commands so they execute under jenkins
Daniel Sangorrin
daniel.sangorrin at toshiba.co.jp
Thu Mar 30 01:04:38 UTC 2017
Instead of using sudo -u jenkins ftc xxx use the user_checks
allows to run the command as jenkins even if the caller
is running as root
Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
engine/scripts/ftc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/engine/scripts/ftc b/engine/scripts/ftc
index eb1eb3e..e08c56a 100755
--- a/engine/scripts/ftc
+++ b/engine/scripts/ftc
@@ -2769,6 +2769,7 @@ def main():
if command=="add-jobs":
# adds Jenkins jobs
+ user_check()
try:
do_add_jobs(conf, options)
except Exception as e:
@@ -2776,6 +2777,7 @@ def main():
if command=="rm-jobs":
# removes Jenkins jobs
+ user_check()
try:
do_rm_jobs(conf, options)
except Exception as e:
@@ -2783,6 +2785,7 @@ def main():
if command=="add-nodes":
# adds Jenkins nodes
+ user_check()
try:
do_add_nodes(conf, options)
except Exception as e:
@@ -2790,6 +2793,7 @@ def main():
if command=="rm-nodes":
# removes Jenkins nodes
+ user_check()
try:
do_rm_nodes(conf, options)
except Exception as e:
@@ -2801,10 +2805,12 @@ def main():
if command=="list-nodes":
# shows jenkins nodes
+ user_check()
do_list_nodes(conf)
if command=="list-jobs":
# shows jenkins jobs
+ user_check()
do_list_jobs(conf)
if command=="list-plans":
--
2.7.4
More information about the Fuego
mailing list