Closed thefreakquency closed 6 years ago
The upgrade.sh
script is provided as a convenience and works for most of the user base. There will always be a subset of users for whom it doesn't work due to constraints placed on their environments. Extending the upgrade script to satisfy unknown constraints (lack of Internet access, reduced filesystem permissions, archiving the old installation, etc.) is outside the scope of the NetBox project. Fortunately, it is trivial to adapt the stock script to conduct an upgrade as appropriate for your specific environment.
Issue type
[ x ] Feature request
Environment
Description
When running the upgrade.sh script on a system that does not have internet access, it can take several minutes to complete due do checks made by pip for every item in the requirements.txt file.
And this goes on an on and on... for over an hour!!!
Although mentioned to install "any new Python packages", the following script section tries to upgrade any package listed in the requirements.txt file even if the required version is met:
Some kind of magic could happen and warn if an item in the requirement is not met without trying to upgrade all of the 20 items to the latest and greatest version...
I see the following possible approaches:
pip freeze -r requirements.txt
against requirements.txt and then warn the user and halt if a dependency is not met.This whole behavior could be activated by an "-offline" switch if not required by the majority of users, or an automated check to the outside world:
wget -q --tries=10 --timeout=20 --spider http://google.com if [[ $? -eq 0 ]]; then echo "Online" else echo "Offline" fi