[GH-ISSUE #135] Unhandled error: <class 'TypeError'>, unsupported operand type(s) for +: 'bool' and 'str', <traceback object at 0x1473f1580> #78

Closed
opened 2026-05-06 12:37:10 +02:00 by BreizhHardware · 0 comments

Originally created by @mmigliari on GitHub (Oct 8, 2024).
Original GitHub issue: https://github.com/patrickchugh/terravision/issues/135

Checking for additional links between 18 resources..
Traceback (most recent call last):
  File "/Users/maximo/repos/other/terravision/terravision", line 289, in <module>
    cli(
  File "/Users/maximo/repos/other/terravision/venv/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maximo/repos/other/terravision/venv/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/maximo/repos/other/terravision/venv/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maximo/repos/other/terravision/venv/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maximo/repos/other/terravision/venv/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maximo/repos/other/terravision/terravision", line 207, in draw
    tfdata = compile_tfdata(source, varfile, workspace, debug, annotate)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maximo/repos/other/terravision/terravision", line 76, in compile_tfdata
    tfdata = graphmaker.handle_special_resources(tfdata)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maximo/repos/other/terravision/modules/graphmaker.py", line 462, in handle_special_resources
    tfdata = getattr(resource_handlers, handler)(tfdata)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maximo/repos/other/terravision/modules/resource_handlers.py", line 372, in aws_handle_lb
    renamed_node = lb_type + "." + "elb"
                   ~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for +: 'bool' and 'str'

It seems like this concatenation is failing in resource_handlers.py because its not casting booleans into strings first.

after changing line 372 of resource_handlers.py to renamed_node = str(lb_type) + "." + "elb" the code ran successfully.

Originally created by @mmigliari on GitHub (Oct 8, 2024). Original GitHub issue: https://github.com/patrickchugh/terravision/issues/135 ``` Checking for additional links between 18 resources.. Traceback (most recent call last): File "/Users/maximo/repos/other/terravision/terravision", line 289, in <module> cli( File "/Users/maximo/repos/other/terravision/venv/lib/python3.11/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/maximo/repos/other/terravision/venv/lib/python3.11/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Users/maximo/repos/other/terravision/venv/lib/python3.11/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/maximo/repos/other/terravision/venv/lib/python3.11/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/maximo/repos/other/terravision/venv/lib/python3.11/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/maximo/repos/other/terravision/terravision", line 207, in draw tfdata = compile_tfdata(source, varfile, workspace, debug, annotate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/maximo/repos/other/terravision/terravision", line 76, in compile_tfdata tfdata = graphmaker.handle_special_resources(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/maximo/repos/other/terravision/modules/graphmaker.py", line 462, in handle_special_resources tfdata = getattr(resource_handlers, handler)(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/maximo/repos/other/terravision/modules/resource_handlers.py", line 372, in aws_handle_lb renamed_node = lb_type + "." + "elb" ~~~~~~~~^~~~~ TypeError: unsupported operand type(s) for +: 'bool' and 'str' ``` It seems like this concatenation is failing in resource_handlers.py because its not casting booleans into strings first. after changing line 372 of resource_handlers.py to ```renamed_node = str(lb_type) + "." + "elb"``` the code ran successfully.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/terravision#78
No description provided.