An efficient tool to execute configuration backups, network state snapshots, system readiness checks, and operating system upgrades of Palo Alto Networks firewalls and Panorama appliances.
After integrating Typer into the pan-os-upgrade script to handle command-line arguments, executing the script via CLI results in a TypeError, indicating missing required positional arguments. This behavior was observed subsequent to the replacement of direct function calls in the script entry point with Typer's CLI runner.
Steps to Reproduce
Run the command pan-os-upgrade in the CLI after installing the package with Poetry.
Observe the resulting TypeError.
Expected Behavior
The script should correctly interpret and accept command-line arguments without throwing errors, utilizing Typer's argument handling capabilities.
Actual Behavior
The script execution fails with a TypeError, stating that main() is missing 4 required positional arguments: 'ip_address', 'username', 'password', and 'target_version'.
Potential Cause
The script's entry point in pyproject.toml was not appropriately updated to reflect the change to Typer. It's currently pointing directly to the main() function, while it should be configured to invoke Typer's CLI runner (app instance) to properly handle the command-line arguments.
Suggested Fix
Modify the [tool.poetry.scripts] section in pyproject.toml to point to the Typer app instance instead of the main() function. For example:
Issue Summary
After integrating Typer into the pan-os-upgrade script to handle command-line arguments, executing the script via CLI results in a TypeError, indicating missing required positional arguments. This behavior was observed subsequent to the replacement of direct function calls in the script entry point with Typer's CLI runner.
Steps to Reproduce
Expected Behavior
The script should correctly interpret and accept command-line arguments without throwing errors, utilizing Typer's argument handling capabilities.
Actual Behavior
The script execution fails with a TypeError, stating that main() is missing 4 required positional arguments: 'ip_address', 'username', 'password', and 'target_version'.
Potential Cause
The script's entry point in pyproject.toml was not appropriately updated to reflect the change to Typer. It's currently pointing directly to the main() function, while it should be configured to invoke Typer's CLI runner (app instance) to properly handle the command-line arguments.
Suggested Fix
Modify the [tool.poetry.scripts] section in pyproject.toml to point to the Typer app instance instead of the main() function. For example: