Skip to content

Commit

Permalink
Merge pull request #392 from nautobot/stable-1.2
Browse files Browse the repository at this point in the history
Stable 1.2
  • Loading branch information
itdependsnetworks authored Nov 3, 2022
2 parents 13d12b7 + 136ec06 commit b22b924
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
2 changes: 2 additions & 0 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
},
},
}
else:
LOGGING = {}

#
# Redis
Expand Down
9 changes: 9 additions & 0 deletions docs/admin/release_notes/version_1.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
- Drop support of Nautobot <1.4.X
- Update docs to mkdocs and read the docs hosting

## v1.2.3 - 2022-11

### Fixed

- [#356](https://github.com/nautobot/nautobot-plugin-golden-config/issues/356) Fix Compliance Rule list view filtering on platform is broken.
- [#385](https://github.com/nautobot/nautobot-plugin-golden-config/pull/385) Fix Compliance Export not working.
- [#384](https://github.com/nautobot/nautobot-plugin-golden-config/pull/384) Fix issue where not correctly rendering intended actual configs on compliance view
- [#387](https://github.com/nautobot/nautobot-plugin-golden-config/pull/387) Fix filter to be in line with Nautobot 1.4, make logging optional in testing.

## v1.2.2 - 2022-10

### Fixed
Expand Down
5 changes: 0 additions & 5 deletions nautobot_golden_config/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ class GoldenConfigFilterSet(CustomFieldModelFilterSet):
tenant_group_id = TreeNodeMultipleChoiceFilter(
queryset=TenantGroup.objects.all(),
field_name="device__tenant__group",
lookup_expr="in",
label="Tenant Group (ID)",
)
tenant_group = TreeNodeMultipleChoiceFilter(
queryset=TenantGroup.objects.all(),
field_name="device__tenant__group",
to_field_name="slug",
lookup_expr="in",
label="Tenant Group (slug)",
)
tenant_id = django_filters.ModelMultipleChoiceFilter(
Expand All @@ -62,13 +60,11 @@ class GoldenConfigFilterSet(CustomFieldModelFilterSet):
region_id = TreeNodeMultipleChoiceFilter(
queryset=Region.objects.all(),
field_name="device__site__region",
lookup_expr="in",
label="Region (ID)",
)
region = TreeNodeMultipleChoiceFilter(
queryset=Region.objects.all(),
field_name="device__site__region",
lookup_expr="in",
to_field_name="slug",
label="Region (slug)",
)
Expand All @@ -86,7 +82,6 @@ class GoldenConfigFilterSet(CustomFieldModelFilterSet):
rack_group_id = TreeNodeMultipleChoiceFilter(
queryset=RackGroup.objects.all(),
field_name="device__rack__group",
lookup_expr="in",
label="Rack group (ID)",
)
rack_group = django_filters.ModelMultipleChoiceFilter(
Expand Down
7 changes: 5 additions & 2 deletions nautobot_golden_config/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ class ComplianceRuleFilterForm(utilities_forms.BootstrapMixin, extras_forms.Cust
model = models.ComplianceRule

q = forms.CharField(required=False, label="Search")
platform = utilities_forms.DynamicModelMultipleChoiceField(queryset=Platform.objects.all(), required=False)
platform = utilities_forms.DynamicModelMultipleChoiceField(
queryset=Platform.objects.all(), to_field_name="slug", required=False, null_option="None"
)

feature = utilities_forms.DynamicModelMultipleChoiceField(
queryset=models.ComplianceFeature.objects.all(), required=False
)
Expand Down Expand Up @@ -237,7 +240,7 @@ class ConfigRemoveFeatureFilterForm(utilities_forms.BootstrapMixin, extras_forms

model = models.ConfigRemove
platform = utilities_forms.DynamicModelMultipleChoiceField(
queryset=Platform.objects.all(), required=False, null_option="None"
queryset=Platform.objects.all(), to_field_name="slug", required=False, null_option="None"
)
name = utilities_forms.DynamicModelChoiceField(
queryset=models.ConfigRemove.objects.all(), to_field_name="name", required=False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ <h1>{% block title %}Configuration Compliance - {{ device.name }}{% endblock %}<
<tr>
<td style="width:250px">Intended Configuration</td>
<td class="config_hover">
<span id="{{ item.rule|slugify }}_intended"><pre>{{ item.in_intended|placeholder }}</pre></span>
<span id="{{ item.rule|slugify }}_intended"><pre>{{ item.intended|placeholder }}</pre></span>
<span class="config_hover_button">
<button class="btn btn-inline btn-default hover_copy_button" data-clipboard-target="#{{ item.rule|slugify }}_intended">
<span class="mdi mdi-content-copy"></span>
Expand All @@ -122,9 +122,9 @@ <h1>{% block title %}Configuration Compliance - {{ device.name }}{% endblock %}<
<tr>
<td style="width:250px">Actual Configuration</td>
<td class="config_hover">
<span id="{{ item.rule|slugify }}_intended"><pre>{{ item.intended|placeholder }}</pre></span>
<span id="{{ item.rule|slugify }}_actual"><pre>{{ item.actual|placeholder }}</pre></span>
<span class="config_hover_button">
<button class="btn btn-inline btn-default hover_copy_button" data-clipboard-target="#{{ item.rule|slugify }}_intended">
<button class="btn btn-inline btn-default hover_copy_button" data-clipboard-target="#{{ item.rule|slugify }}_actual">
<span class="mdi mdi-content-copy"></span>
</button>
</span>
Expand Down
2 changes: 1 addition & 1 deletion nautobot_golden_config/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def convert_to_str(val):
raise ValueError(f"Expecting one of 'N/A', 0, or 1, got {val}")

csv_data = []
headers = sorted(list(models.ComplianceFeature.objects.values_list("name", flat=True).distinct()))
headers = sorted(list(models.ComplianceFeature.objects.values_list("slug", flat=True).distinct()))
csv_data.append(",".join(list(["Device name"] + headers)))
for obj in self.alter_queryset(None):
# From all of the unique fields, obtain the columns, using list comprehension, add values per column,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nautobot-golden-config"
version = "1.2.2"
version = "1.2.3"
description = "A plugin for configuration on nautobot"
authors = ["Network to Code, LLC", "<[email protected]>"]

Expand Down

0 comments on commit b22b924

Please sign in to comment.