Merge pdbq:add-collect-watch into pdbq:main
Status: | Merged |
---|---|
Merge reported by: | Bryce Harrington |
Merged at revision: | a00dcaebcc2ab4b8a1ac261fb9eea91f3363f90d |
Proposed branch: | pdbq:add-collect-watch |
Merge into: | pdbq:main |
Diff against target: |
252 lines (+126/-42) 1 file modified
workers/collect-watch (+126/-42) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Athos Ribeiro (community) | Approve | ||
Canonical Server Reporter | Pending | ||
Review via email: mp+439139@code.staging.launchpad.net |
Description of the change
I've used a bash script, ./scripts/
This completes a rewrite of that bash script to python, and refactors things to be a bit more pythonic. I will probably do a bit more hacking on it before setting up the cronjob for it, but it's at a good stage for reviewing.
For a bit of extra context, for Pdbq 'workers' are intended to be run as discrete jobs to pull data from remote sites and re-process it into JSON records. This is not the first worker script for Pdbq but my objective is to make this one fully fleshed out so it can serve as an example of a "finished" worker. So, review comments to cleanup the style or fix the syntax or to simplify the code would be much appreciated.
There is a smoketest:
$ ./workers/
Retrieved information for package:
{'debian-
'debian-
'package': 'hello',
'status': 'newer package available',
'upstream-url': 'https:/
'upstream-
Expected:
{'debian-
'debian-
'package': 'hello',
'status': 'newer package available',
'upstream-url': 'https:/
'upstream-
output matches example
For a regular run, create a /tmp/input.json file with contents like this:
{
"
"
"
"logging": false
}
Then run:
$ ./workers/
{
"contents": {
"status": "newer package available",
},
"
"
"
}
There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.
LGTM :)