Code review comment for lp://staging/~brendan-donegan/hwcert-tools/datacentres_api_update

Revision history for this message
Daniel Manrique (roadmr) wrote :

result.json can be an attribute or a method, depending on the version of requests that you're using. This tripped me up a bit; I think the hasattr code block is meant to handle it but I can tell you it doesn't work for that, it crashed for me until I changed all results.json instances in the script to use the method rather than the attribute.

Once I got it running, it took several minutes. Maybe later you'll want to use session rather than plain requests to speed things up a bit and reduce some more load on the server.

Also, running flake8 on the script spits out about 20 pep8 noncompliances, which may be good to solve at some point. They weren't introduced by this patch so we can handle that later if desired.

As long as this runs OK with the version of requests that's on the satellites I'm OK with it.

review: Approve

« Back to merge proposal