Skip to content

Commit

Permalink
Merge pull request #42 from cdot65/40-enhance-network-related-error-h…
Browse files Browse the repository at this point in the history
…andling-for-user-clarity

Update CLI argument from --ip-address to --hostname
  • Loading branch information
cdot65 authored Jan 21, 2024
2 parents 35b6e2f + 9dc0d2a commit 8fe3a07
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Example Execution
<div class="termy">

```console
pan-os-upgrade --ip-address 192.168.255.211 --username admin --password secret --version 10.2.0-h2
pan-os-upgrade --hostname 192.168.255.211 --username admin --password secret --version 10.2.0-h2
INFO - ✅ Connection to firewall established
INFO - 📝 007054000123456 houston 192.168.255.211
INFO - 📝 Firewall HA mode: disabled
Expand Down Expand Up @@ -175,7 +175,7 @@ You can simply get started by issuing `pan-os-upgrade` from your current working

```bash
$ pan-os-upgrade
IP address: 192.168.255.1
Firewall Hostname or IP: 192.168.255.1
Username: admin
Password:
Target PAN-OS version: 11.1.1
Expand All @@ -193,13 +193,13 @@ INFO - ✅ Confirmed that moving from 11.0.2 to 11.1.1 is an upgrade
Alternatively, you can pass these details as command-line arguments when running the script:
```bash
pan-os-upgrade --ip-address 192.168.1.1 --username admin --password secret --version 10.1.0
pan-os-upgrade --hostname 192.168.1.1 --username admin --password secret --version 10.1.0
```
For a dry run:
```bash
pan-os-upgrade --ip-address 192.168.1.1 --username admin --password secret --version 10.1.0 --dry-run
pan-os-upgrade --hostname 192.168.1.1 --username admin --password secret --version 10.1.0 --dry-run
```
<p align="right">(<a href="#readme-top">back to top</a>)</p>
Expand Down Expand Up @@ -261,14 +261,14 @@ pan-os-upgrade --help
### CLI Arguments Description
| cli argument | shorthand | type | description |
| -------------- | --------- | ---- | ----------------------------------------------------------------------------------- |
| `--dry-run` | `-d` | n/a | Perform a dry run of all tests and downloads without performing the actual upgrade. |
| `--ip-address` | `-i` | text | IP address of target firewall. |
| `--log-level` | `-l` | text | Set the logging output level (e.g., debug, info, warning). |
| `--password` | `-p` | text | Password for authentication. |
| `--username` | `-u` | text | Username for authentication. |
| `--version` | `-v` | text | Target PAN-OS version to upgrade to. |
| cli argument | shorthand | type | description |
| ------------- | --------- | ---- | ----------------------------------------------------------------------------------- |
| `--dry-run` | `-d` | n/a | Perform a dry run of all tests and downloads without performing the actual upgrade. |
| `--hostname` | `-h` | text | Hostname or IP address of target firewall. |
| `--log-level` | `-l` | text | Set the logging output level (e.g., debug, info, warning). |
| `--password` | `-p` | text | Password for authentication. |
| `--username` | `-u` | text | Username for authentication. |
| `--version` | `-v` | text | Target PAN-OS version to upgrade to. |
<p align="right">(<a href="#readme-top">back to top</a>)</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Visit the [User Guide](user-guide/introduction.md) for detailed insights into se
<div class="termy">

```console
$ pan-os-upgrade --ip-address 192.168.255.211 --version 10.2.0-h2 --username admin --password paloalto#1
$ pan-os-upgrade --hostname 192.168.255.211 --version 10.2.0-h2 --username admin --password paloalto#1
INFO - ✅ Connection to firewall established
INFO - 📝 007054000123456 houston 192.168.255.211
INFO - 📝 Firewall HA mode: disabled
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/docker/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Encountering issues during the Docker execution of `pan-os-upgrade` can happen,

**Problem:** The script within the Docker container cannot connect to the PAN-OS device.

**Solution:** Verify network settings and ensure the Docker container has network access. Check firewall settings and IP address.
**Solution:** Verify network settings and ensure the Docker container has network access. Check firewall settings, Hostname, and IP address.

### 7. Docker Version Compatibility

Expand Down
24 changes: 12 additions & 12 deletions docs/user-guide/python/execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ You can start the script by simply issuing `pan-os-upgrade` from your current wo

```console
$ pan-os-upgrade
IP address: 192.168.255.1
Hostname or IP: 192.168.255.1
Username: admin
Password:
Target PAN-OS version: 11.1.1
Expand Down Expand Up @@ -71,13 +71,13 @@ INFO - ✅ Firewall upgraded and rebooted in 542 seconds
Alternatively, you can pass these details as command-line arguments:

```bash
$ pan-os-upgrade --ip-address 192.168.1.1 --username admin --password secret --version 10.1.0
$ pan-os-upgrade --hostname 192.168.1.1 --username admin --password secret --version 10.1.0
```

<div class="termy">

```console
pan-os-upgrade --ip-address 192.168.255.211 --username admin --password secret --version 10.2.0-h2
pan-os-upgrade --hostname 192.168.255.211 --username admin --password secret --version 10.2.0-h2
INFO - ✅ Connection to firewall established
INFO - 📝 007054000123456 houston 192.168.255.211
INFO - 📝 Firewall HA mode: disabled
Expand Down Expand Up @@ -131,21 +131,21 @@ INFO - ✅ Firewall upgraded and rebooted in 542 seconds
For a dry run:

```bash
$ pan-os-upgrade --ip-address 192.168.1.1 --username admin --password secret --version 10.1.0 --dry-run
$ pan-os-upgrade --hostname 192.168.1.1 --username admin --password secret --version 10.1.0 --dry-run
```

### CLI Arguments Description

When using command-line arguments, the following options are available:

| Argument | Description | Required |
| -------------- | -------------------------------------------------------------------- | -------- |
| `--ip-address` | IP address of the target PAN-OS firewall. | Yes |
| `--username` | Username for authentication with the firewall. | Yes |
| `--password` | Password for authentication with the firewall. | Yes |
| `--version` | Target PAN-OS version to upgrade to. | Yes |
| `--dry-run` | Perform a dry run of all tests and downloads without actual upgrade. | No |
| `--log-level` | Set the logging output level (e.g., debug, info, warning). | No |
| Argument | Description | Required |
| ------------- | -------------------------------------------------------------------- | -------- |
| `--hostname` | Hostname or IP address of the target PAN-OS firewall. | Yes |
| `--username` | Username for authentication with the firewall. | Yes |
| `--password` | Password for authentication with the firewall. | Yes |
| `--version` | Target PAN-OS version to upgrade to. | Yes |
| `--dry-run` | Perform a dry run of all tests and downloads without actual upgrade. | No |
| `--log-level` | Set the logging output level (e.g., debug, info, warning). | No |

Note: The use of an API key and `.env` file for configuration is no longer supported.

Expand Down
4 changes: 2 additions & 2 deletions pan_os_upgrade/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -1548,8 +1548,8 @@ def main(
typer.Option(
"--hostname",
"-h",
help="Hostname or IP address of target firewall",
prompt="Hostname or IP address",
help="Hostname or IP of target firewall",
prompt="Hostname or IP",
callback=ip_callback,
),
],
Expand Down

0 comments on commit 8fe3a07

Please sign in to comment.