Merge lp:~fboudra/linaro-license-protection/create-latest-symlink-for-prebuilt-job-type into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Fathi Boudra
Status: Merged
Approved by: James Tunnicliffe
Approved revision: 154
Merged at revision: 154
Proposed branch: lp:~fboudra/linaro-license-protection/create-latest-symlink-for-prebuilt-job-type
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 30 lines (+8/-2)
1 file modified
scripts/publish_to_snapshots.py (+8/-2)
To merge this branch: bzr merge lp:~fboudra/linaro-license-protection/create-latest-symlink-for-prebuilt-job-type
Reviewer Review Type Date Requested Status
James Tunnicliffe (community) Approve
Review via email: mp+141576@code.launchpad.net

Description of the change

Create latest symlink for prebuilt job type

To post a comment you must log in.
Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Thanks for this. Looks OK, but a test would be nice (tests/test_publish_to_snapshots.py)

review: Needs Fixing
Revision history for this message
Fathi Boudra (fboudra) wrote :

it's already tested in the existing tests

Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Ah, OK then. If it wasn't tested before (clearly no tests have changed and I assume they still pass), then lets get this merged.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/publish_to_snapshots.py'
2--- scripts/publish_to_snapshots.py 2012-12-05 14:35:12 +0000
3+++ scripts/publish_to_snapshots.py 2013-01-02 00:01:22 +0000
4@@ -208,7 +208,11 @@
5
6 return build_dir_path, target_dir_path
7
8- def create_symlink(self, args, target_dir_path):
9+ def create_symlink(self, args, build_dir_path, target_dir_path):
10+ if args.job_type == "prebuilt":
11+ for root, dirs, files in os.walk(build_dir_path):
12+ for dir in dirs:
13+ target_dir_path = os.path.join(target_dir_path, dir)
14 symlink_path = os.path.dirname(target_dir_path)
15 if args.job_type == "android":
16 symlink_path = os.path.join(symlink_path, "lastSuccessful")
17@@ -332,11 +336,13 @@
18 sanitize=args.staging)
19
20 if (args.job_type == "android" or
21+ args.job_type == "prebuilt" or
22 args.job_type == "ubuntu-hwpacks" or
23 args.job_type == "ubuntu-images" or
24 args.job_type == "ubuntu-restricted" or
25 args.job_type == "ubuntu-sysroots"):
26- ret = self.create_symlink(args, target_dir_path)
27+ ret = self.create_symlink(
28+ args, build_dir_path, target_dir_path)
29 if ret != PASS:
30 return ret
31

Subscribers

People subscribed via source and target branches