Scripts with import statement from other file #14108
-
Running version 3.6.4 I have a problem moving my scripts from 3.3.6. My problem is that my script isn´t one file. How do I handle this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
There's no great way to handle this in 3.5+. We moved to a plugin for our custom scripts instead: https://github.com/kkthxbye-code/netbox-script-manager If that's not an option, you might be able to place your dependencies in the backing script directory manually and then upload only the main script file. It's a mess to keep in sync though with some files originating from netbox and some files manually kept up to date. |
Beta Was this translation helpful? Give feedback.
-
How do we handle passwords, tokens etc? |
Beta Was this translation helpful? Give feedback.
It works!
import sys
sys.path.append('/srv/netbox/shared/scripts')