Merge lp://qastaging/~fboudra/linaro-ci/use-new-api-to-download-file into lp://qastaging/linaro-ci

Proposed by Fathi Boudra
Status: Merged
Approved by: Milo Casagrande
Approved revision: 140
Merged at revision: 140
Proposed branch: lp://qastaging/~fboudra/linaro-ci/use-new-api-to-download-file
Merge into: lp://qastaging/linaro-ci
Diff against target: 147 lines (+114/-27)
1 file modified
download_file (+114/-27)
To merge this branch: bzr merge lp://qastaging/~fboudra/linaro-ci/use-new-api-to-download-file
Reviewer Review Type Date Requested Status
Milo Casagrande (community) Approve
Review via email: mp+157823@code.qastaging.launchpad.net

Description of the change

Switch download file to the new API.

It's the example provided by James in http://bazaar.launchpad.net/~linaro-automation/linaro-license-protection/trunk/view/head:/scripts/download.py with some minor changes to make it non-interactive for automated CI purpose.

To post a comment you must log in.
Revision history for this message
Milo Casagrande (milo) wrote :

Hi Fathi,

overall it looks good, I guess the automation for the non-interactiveness is the use of the env variable:

+ skip_license = os.environ.get('SKIP_LICENSE')
+ if skip_license is None:
+ # Licenses are stored as HTML. Convert them to markdown
+ # (text) and print it to the terminal.
+ print html2text(lic["text"])
+
+ # Ask the user if they accept the license. If they don't we
+ # terminate the script.
+ user_response = raw_input(
+ "Do you accept this license? (y/N)")
+ if user_response != "y":
+ exit(1)

Why not just skip all that part? I guess this will be only used inside a CI job.
Anyway, it is not a big deal and is good to go even like it is now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches