Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netbox 3.6 support #24

Closed
wants to merge 0 commits into from
Closed

netbox 3.6 support #24

wants to merge 0 commits into from

Conversation

ff05
Copy link

@ff05 ff05 commented Sep 14, 2023

The structure of netbox utilities library changed.
because of that some classes couldnt be found.

Now the Fields start_date and expiration_date are selectable with DatePicker
closes issue #22

Added these fields to licenses
license_key
license_count
users if a license is tied to a user and not to a device
comments

setup.cfg Outdated
@@ -1,6 +1,6 @@
[metadata]
name = netbox-slm
version = 1.4
version = 1.5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually the version is bumped where there's a collection of changes to be shipped

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove it with the next commit

README.md Outdated
``configuration/extra.py``.
2. Create a ``plugin_requirements.txt`` with ``netbox-slm==1.2`` as
``configuration/plugins.py``.
2. Create a ``plugin_requirements.txt`` with ``netbox-slm`` as
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing #23 !

start_date = forms.DateField(
label=_('Start date'),
required=False,
widget=DatePicker()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing #22 !


from netbox.forms import NetBoxModelForm, NetBoxModelImportForm, NetBoxModelBulkEditForm, NetBoxModelFilterSetForm
from netbox_slm.models import SoftwareProduct, SoftwareProductVersion, SoftwareProductInstallation, SoftwareLicense
from utilities.forms import DynamicModelChoiceField, APISelect, TagFilterField
from utilities.forms.fields import DynamicModelChoiceField, TagFilterField
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing #21 !

@@ -46,6 +46,10 @@ class Migration(migrations.Migration):
('software_product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='netbox_slm.softwareproduct')),
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
('version', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='netbox_slm.softwareproductversion')),
('license_key', models.CharField(blank=True, max_length=255, null=True)),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should generate a new migration (can be done with the makemigrations django command) instead of adding to this one. Existing v1.4 installations of the plugin will otherwise not have these fields.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will push it with the next commit

@@ -4,6 +4,7 @@

from netbox.models import NetBoxModel
from utilities.querysets import RestrictedQuerySet
from utilities.forms.fields import CommentField
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be unused, was probably intended elsewhere?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a mistake and shouldnt be pushed.
I will remove it with the next commit

@@ -113,12 +114,25 @@ class SoftwareLicense(NetBoxModel):
null=True,
blank=True
)
license_key = models.CharField(max_length=255, null=True, blank=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requirements of #8 stated that the key should not actually be stored in netbox (it would typically be vaulted somewhere).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't seen #8 Will be removed

@@ -62,4 +74,4 @@ <h5 class="card-header">
{% plugin_full_width_page object %}
</div>
</div>
{% endblock %}
{% endblock %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's convenient to include newline EOF

@@ -1,8 +1,11 @@
from django.urls import reverse_lazy
from django import forms
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the DateField be imported directly from forms, instead of the whole package?

verbose_name='users',
blank=True
)
comments = models.TextField(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are these additional fields license_count, users, and comments intended to be used?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example a confluence Server License:
license_count: number of licensed Users
users: users currently assigned
comment: users get there license via ldap group synchronization

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's interesting. Perhaps you can also open a new issue (feature request) in this repository and we can work out the details. I'll also be adding an extra storage location URL field to point to the license key (stored externally)

@wkoot wkoot mentioned this pull request Sep 14, 2023
@ff05 ff05 changed the title 1.5 netbox 3.6 support Sep 15, 2023
@ff05 ff05 closed this Sep 15, 2023
@ff05 ff05 deleted the 1.5 branch September 15, 2023 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants