Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error message when passing string into CheckFirewall run_snapshots #144

Open
cdot65 opened this issue Jan 15, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@cdot65
Copy link
Contributor

cdot65 commented Jan 15, 2024

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
@cdot65 cdot65 added the bug Something isn't working label Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant