3 Commits
5 changed files with 19 additions and 20 deletions
+3 -2
View File
@@ -9,6 +9,8 @@ Software Lifecycle Management
Installation Guide Installation Guide
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
WARNING: This plugin requires Netbox 3.1.X or higher!
When using the Docker version of Netbox, first follow the `netbox-docker When using the Docker version of Netbox, first follow the `netbox-docker
quickstart <https://github.com/netbox-community/netbox-docker#quickstart>`__ quickstart <https://github.com/netbox-community/netbox-docker#quickstart>`__
instructions to clone the netbox-docker repo and set up the instructions to clone the netbox-docker repo and set up the
@@ -20,7 +22,7 @@ to install the Netbox SLM plugin:
1. Add ``netbox_slm`` to the ``PLUGINS`` list in 1. Add ``netbox_slm`` to the ``PLUGINS`` list in
``configuration/extra.py``. ``configuration/extra.py``.
2. Create a ``plugin_requirements.txt`` with ``netbox-slm==0.94`` as 2. Create a ``plugin_requirements.txt`` with ``netbox-slm==0.95`` as
contents. contents.
3. Create a ``Dockerfile-SLM`` with contents: 3. Create a ``Dockerfile-SLM`` with contents:
@@ -96,7 +98,6 @@ Steps
$ git clone https://github.com/netbox-community/netbox $ git clone https://github.com/netbox-community/netbox
$ cd netbox $ cd netbox
$ git checkout f5356b8 (to pin 3.0.9)
install the virtual environment install the virtual environment
+6 -16
View File
@@ -14,19 +14,19 @@ quickstart <https://github.com/netbox-community/netbox-docker#quickstart>`__
instructions to clone the netbox-docker repo and set up the instructions to clone the netbox-docker repo and set up the
``docker-compose.override.yml``. ``docker-compose.override.yml``.
Next, follow these instructions (based on the generic `Netbox plugin Next, follow these instructions (based on the `Netbox docker variant
instructions <https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins>`__) instructions <https://github.com/netbox-community/netbox-docker/wiki/Configuration#custom-configuration-files>`__)
to install the Netbox SLM plugin: to install the Netbox SLM plugin:
1. Add ``netbox_slm`` to the ``PLUGINS`` list in 1. Add ``netbox_slm`` to the ``PLUGINS`` list in
``configuration/configuration.py``. ``configuration/extra.py``.
2. Create a ``plugin_requirements.txt`` with ``netbox-slm==0.93`` as 2. Create a ``plugin_requirements.txt`` with ``netbox-slm==0.94`` as
contents. contents.
3. Create a ``Dockerfile-SLM`` with contents: 3. Create a ``Dockerfile-SLM`` with contents:
.. code:: dockerfile .. code:: dockerfile
FROM netboxcommunity/netbox:v3.0.9 # The Netbox SLM plugin currently only works with v3.0.9 of Netbox due to backwards incompatible changes in newer version of Netbox FROM netboxcommunity/netbox:v3.X.X
COPY ./plugin_requirements.txt / COPY ./plugin_requirements.txt /
RUN /opt/netbox/venv/bin/pip install --no-warn-script-location -r /plugin_requirements.txt RUN /opt/netbox/venv/bin/pip install --no-warn-script-location -r /plugin_requirements.txt
@@ -63,7 +63,7 @@ directory run
:: ::
# make sure to update the version in netbox_slm/__init__.py and setup.cfg # make sure to update the version in netbox_slm/__init__.py
$ python setup.py sdist $ python setup.py sdist
$ twine upload dist/* $ twine upload dist/*
@@ -87,15 +87,6 @@ Netbox Django copy with auto-reload to develop the plugin pointing to
the Dockerized postgres and redis instances, basically ignoring the the Dockerized postgres and redis instances, basically ignoring the
netbox docker runtime server. netbox docker runtime server.
Gotchas
~~~~~~~~
*Netboxs exception handler seems to supress initial Exceptions,
obfuscating missing imports or other Django related issues by re-raising
an opague error, e.g. netbox_slm plugin namespace doesnotexist. Its
recommended to often check the runtime server or patch Netboxs global
exception handler.*
Steps Steps
~~~~~ ~~~~~
@@ -105,7 +96,6 @@ Steps
$ git clone https://github.com/netbox-community/netbox $ git clone https://github.com/netbox-community/netbox
$ cd netbox $ cd netbox
$ git checkout f5356b8 (to pin 3.0.9)
install the virtual environment install the virtual environment
+1 -1
View File
@@ -5,7 +5,7 @@ class SLMConfig(PluginConfig):
name = 'netbox_slm' name = 'netbox_slm'
verbose_name = 'Software Lifecycle Management' verbose_name = 'Software Lifecycle Management'
description = 'Software Lifecycle Management' description = 'Software Lifecycle Management'
version = '0.95' version = '0.96'
author = 'Hedde van der Heide' author = 'Hedde van der Heide'
author_email = 'hedde.vanderheide@ictu.nl' author_email = 'hedde.vanderheide@ictu.nl'
base_url = 'slm' base_url = 'slm'
+8
View File
@@ -142,5 +142,13 @@ class SoftwareProductInstallationTable(NetBoxTable):
"tags", "tags",
) )
def order_platform(self, queryset, is_descending):
queryset = queryset.order_by(("device" if is_descending else "virtualmachine"))
return queryset, True
def order_type(self, queryset, is_descending):
queryset = queryset.order_by(("device" if is_descending else "virtualmachine"))
return queryset, True
def render_software_product(self, value, **kwargs): def render_software_product(self, value, **kwargs):
return f"{kwargs['record'].software_product.manufacturer.name} - {value}" return f"{kwargs['record'].software_product.manufacturer.name} - {value}"
+1 -1
View File
@@ -1,6 +1,6 @@
[metadata] [metadata]
name = netbox-slm name = netbox-slm
version = 0.95 version = 0.96
description = Software Lifecycle Management Netbox Plugin. description = Software Lifecycle Management Netbox Plugin.
# long_description = file: README.rst # long_description = file: README.rst
# long_description_content_type='text/x-rst' # long_description_content_type='text/x-rst'