From ff4d8430acac3e13bad8c82139c1145e60454215 Mon Sep 17 00:00:00 2001 From: collin-koss Date: Wed, 18 Mar 2026 14:51:47 -0700 Subject: [PATCH 1/3] Bugfix for devices not in Central/provisioned passing device validation causing traceback. --- rename-hostnames/renaming_hostnames.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rename-hostnames/renaming_hostnames.py b/rename-hostnames/renaming_hostnames.py index 173b783..cb5a304 100644 --- a/rename-hostnames/renaming_hostnames.py +++ b/rename-hostnames/renaming_hostnames.py @@ -140,7 +140,13 @@ def checking_devices(scope, serial_number): device_function = getattr(device_object, "config_persona", None) provisioned = getattr(device_object, "provisioned_status", None) - if provisioned is False: + if not device_object: + spinner.fail() + print( + f" {colored('Error', 'red')}: Device with serial number {colored(serial_number, 'blue')} not found in Central.\n" + ) + status.append("failure") + elif not provisioned: spinner.fail() print( f" {colored('Error', 'red')}: Device {colored(serial_number, 'blue')} not provisioned in Central.\n" From a601f4d2b78d77c3cf5a36f56c53b7e314226da6 Mon Sep 17 00:00:00 2001 From: Karthik Satheesh Kumar Date: Mon, 23 Mar 2026 11:15:38 -0700 Subject: [PATCH 2/3] Updated requirements.txt to use latest version of pycentral --- rename-hostnames/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rename-hostnames/requirements.txt b/rename-hostnames/requirements.txt index eabe2d6..51d5d50 100644 --- a/rename-hostnames/requirements.txt +++ b/rename-hostnames/requirements.txt @@ -1,2 +1,2 @@ halo==0.0.31 -pycentral==2.0a11 \ No newline at end of file +pycentral==2.0a16 \ No newline at end of file From 6c351e18c553c7a53c2b5c27da8a181269bd792b Mon Sep 17 00:00:00 2001 From: Karthik Satheesh Kumar Date: Mon, 23 Mar 2026 11:16:40 -0700 Subject: [PATCH 3/3] Updated version of SDK on README.md --- rename-hostnames/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rename-hostnames/README.md b/rename-hostnames/README.md index 1a1e230..d29af20 100644 --- a/rename-hostnames/README.md +++ b/rename-hostnames/README.md @@ -28,7 +28,7 @@ source venv/bin/activate # On Windows use: venv\Scripts\activate pip install -r requirements.txt ``` -_This workflow is tested on the PyCentral SDK (version: 2.0a11). Please check compatibility before executing on older/newer versions as there may be changes_ +_This workflow is tested on the PyCentral SDK (version: 2.0a16). Please check compatibility before executing on older/newer versions as there may be changes_ ## Configuration @@ -110,7 +110,7 @@ seria2,hostname2,failure - Authentication / tokens: Ensure your credentials file is complete and has valid credentials for Central. - Ensure all target devices have been assigned a device function and are ready for provisioning - Ensure hostnames are a valid format for the device type they are attempting to be assigned to -- SDK compatibility: If API calls fail unexpectedly, confirm the installed pycentral version matches tested versions (v2.0a11) or update helpers accordingly. +- SDK compatibility: If API calls fail unexpectedly, confirm the installed pycentral version matches tested versions (v2.0a16) or update helpers accordingly. ## Support