Skip to content

No proper error show when Node is not found #90

@davidban77

Description

@davidban77

Trying to retrieve the in the following manner does not provide a clear NOT FOUND error:

In [31]: cloud2 = Node(name="Cloud2", project_id=prj.project_id, connector=gns3_server)

In [32]: try:
    ...:     cloud2.get()
    ...: except:
    ...:     console.print_exception()
    ...:
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ <ipython-input-32-0e5e4b055f2c>:2 in <module>                                                    │
│                                                                                                  │
│ /Users/netpanda/miniconda3/envs/labify/lib/python3.8/site-packages/gns3fy/gns3fy.py:509 in       │
│ wrapper                                                                                          │
│                                                                                                  │
│    506 │   │   │   │   │   raise ValueError(                                                     │
│    507 │   │   │   │   │   │   "Multiple nodes found with same name. Need to submit node_id"     │
│    508 │   │   │   │   │   )                                                                     │
│ ❱  509 │   │   │   │   self.node_id = extracted[0]["node_id"]                                    │
│    510 │   │   # Checks for Link                                                                 │511 │   │   if self.__class__.__name__ == "Link":                                             │
│    512 │   │   │   if not self.link_id:                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions