ansible-collections / ansible-collections/google.cloud

`gcp_compute_route` fails every time for more than a year

Open
#225 4 comments 1 reaction 0 assignees View on GitHub
stale
Dominant language
Python
Stars
105
Forks
144
Avg merge
5d 10h
Merged PRs (30d)
4

Description

##### SUMMARY

`gcp_compute_route` fails with a TypeError.

This is a transfer of https://github.com/ansible/ansible/issues/55153.

It is more than a year that you are offering a module that breaks your users' apps. Your modules [deprecated community ones](https://github.com/ansible/ansible/pull/27252) that could at least perform what they claimed they do. Could there at least be some professionalism and some community feedback here?

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME

`gcp_compute_route`

##### ANSIBLE VERSION

```paste below
ansible 2.10.0.dev0
config file = None
configured module search path = ['/home/nikos/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.8/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.8.1 (default, Jan 22 2020, 06:38:00) [GCC 9.2.0]
```

##### CONFIGURATION

```paste below
None
```

##### OS / ENVIRONMENT

irrelevant

##### STEPS TO REPRODUCE

```yaml
gcp_compute_route:
name: name-here
dest_range: 192.168.0.0/24
next_hop_instance:
selfLink: zones/europe-west1-b/instances/vpn
priority: 100
```

##### EXPECTED RESULTS

No errors.

##### ACTUAL RESULTS

```paste below
The full traceback is:
Traceback (most recent call last):
File "", line 102, in
File "", line 94, in _ansiballz_main
File "", line 40, in invoke_module
File "/usr/lib/python3.8/runpy.py", line 206, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible_collections/google/cloud/plugins/modules/gcp_compute_route.py", line 539, in
File "/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible_collections/google/cloud/plugins/modules/gcp_compute_route.py", line 391, in main
File "/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible/module_utils/basic.py", line 2043, in exit_json
File "/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible/module_utils/basic.py", line 2012, in _return_formatted
File "/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible/module_utils/basic.py", line 722, in warn
File "/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible/module_utils/common/warnings.py", line 18, in warn
return _formatwarnmsg_impl(msg)
TypeError: warn requires a string not a
fatal: [slagfalt-vpn -> localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File \"\", line 102, in \n File \"\", line 94, in _ansiballz_main\n File \"\", line 40, in invoke_module\n File \"/usr/lib/python3.8/runpy.py\", line 206, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.8/runpy.py\", line 96, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.8/runpy.py\", line 86, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible_collections/google/cloud/plugins/modules/gcp_compute_route.py\", line 539, in \n File \"/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible_collections/google/cloud/plugins/modules/gcp_compute_route.py\", line 391, in main\n File \"/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible/module_utils/basic.py\", line 2043, in exit_json\n File \"/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible/module_utils/basic.py\", line 2012, in _return_formatted\n File \"/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible/module_utils/basic.py\", line 722, in warn\n File \"/tmp/ansible_gcp_compute_route_payload_yo8rsw04/ansible_gcp_compute_route_payload.zip/ansible/module_utils/common/warnings.py\", line 18, in warn\n return _formatwarnmsg_impl(msg)\nTypeError: warn requires a string not a \n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
```

Contributor guide

Open the contributing guide

Research direction

Start in ansible_collections/google/cloud/plugins/modules/gcp_compute_route.py, especially main at the traceback's reported line, and follow the exit path into ansible/module_utils/common/warnings.py. Reproduce the supplied route configuration and verify that the module completes without the TypeError and reports the expected successful result.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, python
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.