Cleaned up trigger_image_creation function
authorEd Bartosh <eduard.bartosh@intel.com>
Mon, 3 Jun 2013 12:07:12 +0000 (15:07 +0300)
committerEd Bartosh <eduard.bartosh@intel.com>
Mon, 3 Jun 2013 13:41:22 +0000 (16:41 +0300)
Change-Id: I59503aaba7612902c60f8a585248218c29821783
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
job_pre_release_obs.py

index b83ee88..1fdc7e2 100755 (executable)
@@ -62,18 +62,15 @@ def trigger_image_creation(images_ks, build_id):
          images_ks (truple list): [(ks_file_name, ks_file_content),]
          build_id (str): the pre-release repo build_id
     """
-    index = 0
-    data = {}
-    for ksname, kickstart in images_ks.items():
-        name = ksname.replace('.ks','')
-        data['name'] = name
-        data['kickstart'] = kickstart
-        data['buildid'] = build_id
-        data['images_path'] = os.path.join("images", name)
-        trigger_next('%s/image_trigger_%s'
-                     %(os.getenv('WORKSPACE'), index),
+    for index, (ksname, kickstart) in enumerate(images_ks.items()):
+        name = ksname.replace('.ks', '')
+        data = {'name': name,
+                'kickstart': kickstart,
+                'buildid': build_id,
+                'images_path': os.path.join("images", name)
+                }
+        trigger_next('%s/image_trigger_%s' % (os.getenv('WORKSPACE'), index),
                      data)
-        index = index + 1
 
 def make_repo(project, repo, backenddb):
     """