4.0.3 Scripts - yet another issue compared to 3.7.x #16405
Replies: 2 comments 3 replies
-
Git(hub/lab/etc) can do this and more. I'm not sure where the idea of this not being possible came from. But anyways, are you using data sources? You can use a "local" file and then when an update happens you just sync the data source and the script gets updated. I've been doing this through a git source and I can't image local is any different. |
Beta Was this translation helpful? Give feedback.
-
I think Netbox manages the files in REPO_DIR=/opt/myrepo
REPO_URL=https://xxxxxxxx.git
if [ -d "$REPO_DIR" ]; then
cd $REPO_DIR
git pull $REPO_URL
else
git clone $REPO_URL $REPO_DIR
fi
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py syncdatasource "myrepo" |
Beta Was this translation helpful? Give feedback.
-
Some background:
This works very well in our current 3.7.x environment. Merging and pushing, a few seconds later scripts are updated and available. Any new classes in an script file is available to be used
Now, as we are looking to future upgrades to the 4.x versions, I have discovered that this no longer works. If I add an class to an existing file, it's not available to be run in Operations or Event rules.
Have there been changes so that also classes are represented in the DB? Is there a way of update DB with new classes? As we are running things through an pipeline with code checks, testing of APis and stuff, so using an Git data source is not really an option.
Beta Was this translation helpful? Give feedback.
All reactions