[Fuego] [PATCH 2/2] ftc: use python-jenkins library to list jobs

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Mon Mar 27 08:25:40 UTC 2017


Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
 engine/scripts/ftc | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/engine/scripts/ftc b/engine/scripts/ftc
index b5c89e9..759e6c7 100755
--- a/engine/scripts/ftc
+++ b/engine/scripts/ftc
@@ -601,16 +601,6 @@ class run_class:
         json.dump(run_map, outfile, sort_keys=True, indent=4, ensure_ascii=False)
         outfile.close()
 
-def get_jenkins_jobs(conf):
-    jmap = {}
-    jdir_list = os.listdir(conf.JENKINS_HOME+"/jobs")
-    for jdir in jdir_list:
-        job_config_path = conf.JENKINS_HOME+"/jobs/"+jdir+"/config.xml"
-        if os.path.isfile(job_config_path):
-            jmap[jdir] = job_config_path
-
-    return jmap
-
 # return a map of {'<target_name>': target_instance }
 def get_fuego_targets(conf):
     # scan board directory, and find the board names
@@ -1100,13 +1090,13 @@ def do_list_nodes(conf):
 def do_list_jobs(conf):
 	global quiet, verbose
 
-	job_list = get_jenkins_jobs(conf).keys()
+	job_list = [job['name'] for job in server.get_jobs()]
 	job_list.sort()
 
 	if not quiet: print "Jenkins jobs in this system:"
 	for job in job_list:
-		if not quiet: print "   ",
-		print "%s" % (job)
+		if not quiet:
+			print "   %s" % (job)
 	sys.exit(0)
 
 def do_list_targets(conf):
-- 
2.7.4




More information about the Fuego mailing list