Merge lp://qastaging/~cypressyew/hwcert-tools/location-tool into lp://qastaging/~hardware-certification/hwcert-tools/reporting-tools

Proposed by Po-Hsu Lin
Status: Merged
Approved by: Daniel Manrique
Approved revision: no longer in the source branch.
Merged at revision: 152
Proposed branch: lp://qastaging/~cypressyew/hwcert-tools/location-tool
Merge into: lp://qastaging/~hardware-certification/hwcert-tools/reporting-tools
Diff against target: 191 lines (+187/-0)
1 file modified
certification_reports/hw_location.py (+187/-0)
To merge this branch: bzr merge lp://qastaging/~cypressyew/hwcert-tools/location-tool
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+228275@code.qastaging.launchpad.net

Description of the change

A new script added - hw_location.py, a tool for changing hardware location.
It includes two predefined jobs, --enabled and --oem

--enabled: change the location of all enabled system to "Unknown", as long as it's empty (output will looks like https://pastebin.canonical.com/114102/)
--oem: search for "return" in hardware comment, and ask you if you want to change it into OEM

Also, if you want to do some single system modification, just use
--cid CID -l location_id

I just found out that we have an API script: "api_utils.py" available.
The next step for this will be using it in this location script.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Looks ok, thanks!

As a comment, we have probably 3 or 4 implementations of an abstraction or library for the C3 API: there's one in checkbox-message-get, another that (I think) Sylvain wrote, another in c3_results_notify.py (on lauma), and another one (called apiutils) in reporting-tools/certification_reports. You have another one, since I notice you're using requests directly. This is OK for now, but we really need to come up with a standard way of doing this, since if you look at the code you'll realize they all do mostly the same thing; having to reinvent batched queries every time is tiresome :)

review: Approve
152. By Po-Hsu Lin

"automatic merge by tarmac [r=roadmr][bug=][author=cypressyew]"

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