From 8aee2ec76d8d9734df77a8b5f27391f29ef7643a Mon Sep 17 00:00:00 2001 From: Matthias Stecher Date: Mon, 7 Mar 2022 15:27:26 +0100 Subject: [PATCH 1/2] __netbox: pass handling of requirements.txt to pip3 Previous handling passed a list of pip packages from the requirements.txt via xargs to the pip install directly. This is error-prone, as shown with the major 3 Netbox release. This type breaks cause of comments inside of it. This commit fixes it, while keeping the compatibility to install gnuicorn separate. --- type/__netbox/gencode-remote | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/type/__netbox/gencode-remote b/type/__netbox/gencode-remote index 5d4b7be..2206b03 100755 --- a/type/__netbox/gencode-remote +++ b/type/__netbox/gencode-remote @@ -51,7 +51,9 @@ fi # Install python dependencies. # avoid gunicorn, because it will be done in an other type grep -v "^gunicorn==" "\$tmpdir/$src/requirements.txt" \ - | xargs /opt/netbox/venv/bin/pip3 install -q + > "\$tmpdir/$src/requirements.txt.new" +/opt/netbox/venv/bin/pip3 install -q -r "\$tmpdir/$src/requirements.txt.new" + EOF if [ -f "$__object/parameter/ldap-server" ]; then From dfaeab2cf5a0d64640e67cdbbc8b26e490a52f72 Mon Sep 17 00:00:00 2001 From: Matthias Stecher Date: Mon, 7 Mar 2022 15:36:13 +0100 Subject: [PATCH 2/2] __netbox: add manpage warning for "big version jumps" As getting myself into trouble while upgrading from 2.10 to 3.1 cause of an migration break which allowing upgrades only from 2.11, I've add this warning or notice to be a bit more aware of this. --- type/__netbox/man.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/type/__netbox/man.rst b/type/__netbox/man.rst index 135304c..1d05b12 100644 --- a/type/__netbox/man.rst +++ b/type/__netbox/man.rst @@ -31,6 +31,12 @@ version on GitHub at the NetBox project page under "`Releases `_". + Too big version jumps can break the NetBox migration path. It's good + practise to don't skip major versions and common that you must upgrade to + the latest minor inside the current major version till you can upgrade to + the next major version. Diffrent version steps must be done manually as + this type only upgrades to the given version directly. + database PostgreSQL database name.