-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
setup.cfg
Outdated
@@ -1,6 +1,6 @@ | |||
[metadata] | |||
name = netbox-slm | |||
version = 1.4 | |||
version = 1.5 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing #23 !
netbox_slm/forms/software_license.py
Outdated
start_date = forms.DateField( | ||
label=_('Start date'), | ||
required=False, | ||
widget=DatePicker() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing #22 !
netbox_slm/forms/software_license.py
Outdated
|
||
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 |
There was a problem hiding this comment.
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)), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
netbox_slm/models.py
Outdated
@@ -4,6 +4,7 @@ | |||
|
|||
from netbox.models import NetBoxModel | |||
from utilities.querysets import RestrictedQuerySet | |||
from utilities.forms.fields import CommentField |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
netbox_slm/models.py
Outdated
@@ -113,12 +114,25 @@ class SoftwareLicense(NetBoxModel): | |||
null=True, | |||
blank=True | |||
) | |||
license_key = models.CharField(max_length=255, null=True, blank=True) |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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 %} |
There was a problem hiding this comment.
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
netbox_slm/forms/software_license.py
Outdated
@@ -1,8 +1,11 @@ | |||
from django.urls import reverse_lazy | |||
from django import forms |
There was a problem hiding this comment.
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?
netbox_slm/models.py
Outdated
verbose_name='users', | ||
blank=True | ||
) | ||
comments = models.TextField( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
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