Fix snapdiff sync error when daily repo base is not present and weekly repo base... 33/101333/1
authorYonghee Han <onstudy@samsung.com>
Thu, 1 Dec 2016 01:35:51 +0000 (10:35 +0900)
committerYonghee Han <onstudy@samsung.com>
Thu, 1 Dec 2016 01:35:51 +0000 (10:35 +0900)
Change-Id: I4955082e1ee7b01c7854ad1e13ed79053e11a799

job_sync_snapdiff.py

index 592856c..ae7bad9 100755 (executable)
@@ -174,24 +174,23 @@ def main():
     daily_repo_base, weekly_repo_base = get_released_build(releases_url,
                                                            repo_path,
                                                            release_name)
-
-    daily_repo_url = os.path.join(daily_repo_base,
-                                  'repos', repo_name, 'packages')
-    weekly_repo_url = os.path.join(weekly_repo_base,
-                                   'repos', repo_name, 'packages')
-    if (daily_repo_base and
-        requests.get(daily_repo_url).status_code == 200):
-        daily_current = generate_diff(daily_repo_url, current_repo_url,
-                                      repo_name, 'daily_current')
-        daily_id = _get_buildid(daily_repo_url)
-        context['repo'].append(('daily_build', daily_id, daily_current))
-
-    if (weekly_repo_base and
-        requests.get(weekly_repo_url).status_code == 200):
-        weekly_current = generate_diff(weekly_repo_url, current_repo_url,
-                                       repo_name, 'weekly_current')
-        weekly_id = _get_buildid(weekly_repo_url)
-        context['repo'].append(('weekly_build', weekly_id, weekly_current))
+    if daily_repo_base:
+        daily_repo_url = os.path.join(daily_repo_base,
+                                      'repos', repo_name, 'packages')
+        if requests.get(daily_repo_url).status_code == 200:
+            daily_current = generate_diff(daily_repo_url, current_repo_url,
+                                          repo_name, 'daily_current')
+            daily_id = _get_buildid(daily_repo_url)
+            context['repo'].append(('daily_build', daily_id, daily_current))
+
+    if weekly_repo_base:
+        weekly_repo_url = os.path.join(weekly_repo_base,
+                                       'repos', repo_name, 'packages')
+        if requests.get(weekly_repo_url).status_code == 200:
+            weekly_current = generate_diff(weekly_repo_url, current_repo_url,
+                                           repo_name, 'weekly_current')
+            weekly_id = _get_buildid(weekly_repo_url)
+            context['repo'].append(('weekly_build', weekly_id, weekly_current))
 
     # generate image diff
     context['images'] = {}