[PR #19698] [MERGED] 19529 fix CLI running of scripts #15707

Closed
opened 2025-12-30 00:23:33 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19698
Author: @arthanson
Created: 6/12/2025
Status: Merged
Merged: 6/16/2025
Merged by: @jnovinger

Base: mainHead: 19529-cli-script


📝 Commits (7)

  • 17cecb0 19529 fix custom script path
  • 39d7ca4 19529 fix custom script path
  • 2ece669 19529 fix custom script path
  • 24b1cb9 19529 fix custom script path
  • 2a4ba5b 19680 add object_change migrator
  • ee873d9 19680 optimize migration
  • a6bbc0b 19680 optimize migration

📊 Changes

2 files changed (+59 additions, -13 deletions)

View changed files

📝 netbox/extras/forms/scripts.py (+3 -13)
netbox/extras/migrations/0129_fix_script_paths.py (+56 -0)

📄 Description

Fixes: #19529

In the file storage case (non Cloud storage) the full path (including SCRIPT_ROOT) was getting saved to the ManagedFile. This issue was masked as the UI Script code handles that condition correctly, but it causes problems when running via the CLI or API.

Also includes a migration to remove the full-path if it exists in Script files, but is skipped if using Cloud storage. Cloud storage scripts are not effected.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/19698 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 6/12/2025 **Status:** ✅ Merged **Merged:** 6/16/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `main` ← **Head:** `19529-cli-script` --- ### 📝 Commits (7) - [`17cecb0`](https://github.com/netbox-community/netbox/commit/17cecb0d0bcb5ef462eaad40b030d49958a773e4) 19529 fix custom script path - [`39d7ca4`](https://github.com/netbox-community/netbox/commit/39d7ca42fb91b5a2f42512173051f2c382c8b87b) 19529 fix custom script path - [`2ece669`](https://github.com/netbox-community/netbox/commit/2ece669bde13a06f87eeec7a601625584cd64416) 19529 fix custom script path - [`24b1cb9`](https://github.com/netbox-community/netbox/commit/24b1cb929771ff18044588bc42bda7a4d1507878) 19529 fix custom script path - [`2a4ba5b`](https://github.com/netbox-community/netbox/commit/2a4ba5bd362f4a1d638c1216e2f10c416ad80ca7) 19680 add object_change migrator - [`ee873d9`](https://github.com/netbox-community/netbox/commit/ee873d922bafb3b91c0712f3a92b4bbea765cab8) 19680 optimize migration - [`a6bbc0b`](https://github.com/netbox-community/netbox/commit/a6bbc0b5cf96c5a0814ec38b194ee334cf8abee9) 19680 optimize migration ### 📊 Changes **2 files changed** (+59 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/forms/scripts.py` (+3 -13) ➕ `netbox/extras/migrations/0129_fix_script_paths.py` (+56 -0) </details> ### 📄 Description ### Fixes: #19529 In the file storage case (non Cloud storage) the full path (including SCRIPT_ROOT) was getting saved to the ManagedFile. This issue was masked as the UI Script code handles that condition correctly, but it causes problems when running via the CLI or API. Also includes a migration to remove the full-path if it exists in Script files, but is skipped if using Cloud storage. Cloud storage scripts are not effected. * tested old script - added from main git branch * tested new script added in this git branch * tested git data source (used: https://github.com/netbox-community/customizations - the scripts/find_orphaned_cables.py is a good one) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:23:33 +01:00
adam closed this issue 2025-12-30 00:23:33 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15707