Rework scripts - #10
felixjeskeleanix wants to merge 39 commits into
Conversation
kostas-petrakis
left a comment
There was a problem hiding this comment.
Great work @felixjeskeleanix!
I start with a draft of comments, so we don't overwhelm the entire PR, then we can move on.
Can you also align the corrections for the rest of the scripts?
P.S Please delete the .DS_Store file
| timeout=TIMEOUT) | ||
| response.raise_for_status() | ||
| access_token = response.json()['access_token'] | ||
| auth_header = 'Bearer ' + access_token |
There was a problem hiding this comment.
It is better to use f string interpolation :)
| auth_header = 'Bearer ' + access_token | |
| auth_header = f'Bearer {access_token}' |
| Example: | ||
| $ python archiveFactsheets.py | ||
|
|
||
| Attributes: |
There was a problem hiding this comment.
In Python we usually use the term Global variables to describe variables used in the context of constants.
| Attributes: | |
| Global variables: |
| response = call(query) | ||
| print (response) | ||
| """ % (id) | ||
| logging.info("delete " + id) |
There was a problem hiding this comment.
Let's help the consumers find their way in the logs. Also note that it is preferred to use single quotes, or at least not mix double with single quotes.
| logging.info("delete " + id) | |
| logging.info(f'Archiving fact sheet with id: {id}') |
| """ % (id) | ||
| logging.info("delete " + id) | ||
| response = call(query, header, LEANIX_REQUEST_URL) | ||
| logging.info(response) |
There was a problem hiding this comment.
It is better to use debug for responses as those usually are not meant to be logged (expensive and noisy).
| logging.info(response) | |
| logging.debug(response) |
60ebc0c to
03a9d04
Compare
Rework of the public scripts.
Changes:
Not yet updated: startIntegrationAPIRun
Reviewer: kostas.petrakis@leanix.net