fix linting and updating maintenance guide

Updating the maintainers guide with updated intructions from
Ansible engineers.

Fixing linting issues, and adding the linter as a GitHub workflow
to ensure there are no regressions.
This commit is contained in:
Yusuke Tsutsumi 2022-12-06 22:06:02 -08:00 committed by Yusuke Tsutsumi
commit a9545c77a4
15 changed files with 91 additions and 74 deletions

View file

@ -1433,7 +1433,7 @@ def main():
elements="dict",
options=dict(
balancing_mode=dict(default="UTILIZATION", type="str"),
# TODO: capacity_scaler does some value normalization
# TODO: capacity_scaler does some value normalization
# server-side, so there needs to be a way to do proper
# value comparison.
capacity_scaler=dict(default="1", type="str"),

View file

@ -961,7 +961,7 @@ options:
paths:
description:
- 'The list of path patterns to match. Each must start with / and the
only place a \* is allowed is at the end following a /. The string fed
only place a \\ * is allowed is at the end following a /. The string fed
to the path matcher does not include any text after the first ? or #,
and those chars are not allowed here.'
elements: str
@ -2522,7 +2522,7 @@ pathMatchers:
paths:
description:
- 'The list of path patterns to match. Each must start with / and the only
place a \* is allowed is at the end following a /. The string fed to the
place a \\* is allowed is at the end following a /. The string fed to the
path matcher does not include any text after the first ? or #, and those
chars are not allowed here.'
returned: success

View file

@ -991,7 +991,7 @@ resources:
paths:
description:
- 'The list of path patterns to match. Each must start with / and the
only place a \* is allowed is at the end following a /. The string
only place a \\* is allowed is at the end following a /. The string
fed to the path matcher does not include any text after the first
? or #, and those chars are not allowed here.'
returned: success

View file

@ -325,7 +325,7 @@ options:
paths:
description:
- 'The list of path patterns to match. Each must start with / and the
only place a \* is allowed is at the end following a /. The string fed
only place a \\* is allowed is at the end following a /. The string fed
to the path matcher does not include any text after the first ? or #,
and those chars are not allowed here.'
elements: str
@ -2899,7 +2899,7 @@ pathMatchers:
paths:
description:
- 'The list of path patterns to match. Each must start with / and the only
place a \* is allowed is at the end following a /. The string fed to the
place a \\* is allowed is at the end following a /. The string fed to the
path matcher does not include any text after the first ? or #, and those
chars are not allowed here.'
returned: success
@ -5489,10 +5489,10 @@ def main():
if fetch:
module.params['fingerprint'] = fetch['fingerprint']
if state == 'present':
if is_different(module, fetch):
update(module, self_link(module), kind)
fetch = fetch_resource(module, self_link(module), kind)
changed = True
if is_different(module, fetch):
update(module, self_link(module), kind)
fetch = fetch_resource(module, self_link(module), kind)
changed = True
else:
delete(module, self_link(module), kind)
fetch = {}

View file

@ -382,7 +382,7 @@ resources:
paths:
description:
- 'The list of path patterns to match. Each must start with / and the
only place a \* is allowed is at the end following a /. The string
only place a \\* is allowed is at the end following a /. The string
fed to the path matcher does not include any text after the first
? or #, and those chars are not allowed here.'
returned: success

View file

@ -535,14 +535,14 @@ def is_different(module, response):
response_vals = {}
for k, v in response.items():
if k in keys_to_ignore:
continue
continue
if k in request:
response_vals[k] = v
request_vals = {}
for k, v in request.items():
if k in keys_to_ignore:
continue
continue
if k in response:
request_vals[k] = v

View file

@ -219,9 +219,9 @@ def main():
fetch = fetch_resource(module, self_link(module))
changed = True
elif not fetch.get("deleted"):
delete(module, self_link(module))
fetch = {}
changed = True
delete(module, self_link(module))
fetch = {}
changed = True
else:
if state == "present":
fetch = create(module, collection(module))
@ -242,7 +242,7 @@ def create(module, link):
def undelete(module, link, etag):
auth = GcpSession(module, "iam")
return return_if_object(module, auth.post(link + ":undelete", {
"etag": etag
"etag": etag
}))
@ -322,8 +322,8 @@ def return_if_object(module, response, allow_not_found=False):
# catches and edge case specific to IAM roles where the role not
# existing returns 400.
if (allow_not_found and response.status_code == 400
and "You can't delete role_id" in response.text):
if (allow_not_found and response.status_code == 400
and "You can't delete role_id" in response.text):
return None
try: