Skip to content

Incorrect error message when passing string into CheckFirewall run_snapshots #144

@cdot65

Description

@cdot65

Describe the bug

It's difficult to justify calling this a bug, but it is an unexpected behavior that I'd like to understand better. When passing a string into the run_snapshots method of the CheckFirewall class object, I'm presented with an error claiming that run_snapshots is a missing attribute of the CheckFirewall object

Expected behavior

actions=["arp_table", "content_version", "ip_sec_tunnels", "license", "nics", "routes", "session_stats"]

for action in actions:
    snapshot_result = snapshot_node.run_snapshot(action)
    results[action] = snapshot_result
 
*** SomeMoreSpecificError: 'run_snapshot' method requires a list of strings instead of a single string

Current behavior

actions=["arp_table", "content_version", "ip_sec_tunnels", "license", "nics", "routes", "session_stats"]

for action in actions:
    snapshot_result = snapshot_node.run_snapshot(action)
    results[action] = snapshot_result
 
*** AttributeError: 'CheckFirewall' object has no attribute 'run_snapshot'

type(snapshot_node)
<class 'panos_upgrade_assurance.check_firewall.CheckFirewall'>

Possible solution

I honestly don't know if this is that big of a deal, as we're talking about an incorrectly passed argument, but you'd expect a more helpful error type to cover situations like this. I'm not sure what's the best way to solve this.

Steps to reproduce

actions=["arp_table", "content_version", "ip_sec_tunnels", "license", "nics", "routes", "session_stats"]

for action in actions:
    snapshot_result = snapshot_node.run_snapshot(action)
    results[action] = snapshot_result

Screenshots

image

Context

Made troubleshooting just a few minutes longer than otherwise.

Your Environment

  • Version used: panos-upgrade-assurance==0.3.1
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3): Python 3.11.2
  • Operating System and version (desktop or mobile): macOS
  • Link to your project: https://github.com/cdot65/pan-os-upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions