Skip to content

Commit

Permalink
Merge pull request #287 from nautobot/drift-manager/pr
Browse files Browse the repository at this point in the history
Cookie updated by NetworkToCode Cookie Drift Manager Tool
  • Loading branch information
jdrew82 authored Jan 9, 2025
2 parents 9004fe6 + 84b83c4 commit c4f8c0c
Show file tree
Hide file tree
Showing 18 changed files with 790 additions and 730 deletions.
4 changes: 2 additions & 2 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"_drift_manager": {
"template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
"template_dir": "nautobot-app",
"template_ref": "refs/tags/nautobot-app-v2.4.0",
"template_ref": "refs/tags/nautobot-app-v2.4.1",
"cookie_dir": "",
"branch_prefix": "drift-manager",
"pull_request_strategy": "create",
Expand All @@ -30,7 +30,7 @@
"poetry"
],
"draft": false,
"baked_commit_ref": "40d9cefc5c5b9f7db4b1c9bdb3e6645a4dc4933c"
"baked_commit_ref": "b5d763fab2885bec541b910e18c19d5a06238648"
}
}
}
File renamed without changes.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: ruff format"
run: "poetry run invoke ruff --action format"
ruff-lint:
Expand All @@ -36,6 +38,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: ruff"
run: "poetry run invoke ruff --action lint"
check-docs-build:
Expand All @@ -47,6 +51,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Check Docs Build"
run: "poetry run invoke build-and-check-docs"
poetry:
Expand All @@ -58,6 +64,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Checking: poetry lock file"
run: "poetry run invoke lock --check"
yamllint:
Expand All @@ -69,6 +77,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: yamllint"
run: "poetry run invoke yamllint"
check-in-docker:
Expand All @@ -91,6 +101,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Constrain Nautobot version and regenerate lock file"
env:
INVOKE_NAUTOBOT_FIREWALL_MODELS_LOCAL: "true"
Expand Down Expand Up @@ -146,6 +158,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Constrain Nautobot version and regenerate lock file"
env:
INVOKE_NAUTOBOT_FIREWALL_MODELS_LOCAL: "true"
Expand Down Expand Up @@ -187,6 +201,8 @@ jobs:
fetch-depth: "0"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Check for changelog entry"
run: |
git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Apache Software License 2.0

Copyright (c) 2024, Network to Code, LLC
Copyright (c) 2025, Network to Code, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions changes/+nautobot-app-v2.4.1.housekeeping
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rebaked from the cookie `nautobot-app-v2.4.1`.
6 changes: 4 additions & 2 deletions development/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ services:
volumes:
- "./nautobot_config.py:/opt/nautobot/nautobot_config.py"
- "../:/source"
# To expose postgres or redis to the host uncomment the following
# postgres:
# To expose postgres (5432), myql (3306) on db service or redis (6379) to the host uncomment the
# following. Ensure to match the 2 idented spaces which to have the service nested under services.
# db:
# ports:
# - "5432:5432"
# - "3306:3306"
# redis:
# ports:
# - "6379:6379"
7 changes: 7 additions & 0 deletions development/docker-compose.mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ services:
- "development.env"
- "creds.env"
- "development_mysql.env"
beat:
environment:
- "NAUTOBOT_DB_ENGINE=django.db.backends.mysql"
env_file:
- "development.env"
- "creds.env"
- "development_mysql.env"
db:
image: "mysql:8"
command:
Expand Down
14 changes: 3 additions & 11 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys

from nautobot.core.settings import * # noqa: F403 # pylint: disable=wildcard-import,unused-wildcard-import
from nautobot.core.settings_funcs import is_truthy, parse_redis_connection
from nautobot.core.settings_funcs import is_truthy

#
# Debug
Expand Down Expand Up @@ -65,16 +65,8 @@
#

# The django-redis cache is used to establish concurrent locks using Redis.
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": parse_redis_connection(redis_database=0),
"TIMEOUT": 300,
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
}
}
# Inherited from nautobot.core.settings
# CACHES = {....}

#
# Celery settings are not defined here because they can be overloaded with
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ nav:
- Extending the App: "dev/extending.md"
- Contributing to the App: "dev/contributing.md"
- Development Environment: "dev/dev_environment.md"
- Release Checklist: "dev/release_checklist.md"
# - Architecture Decision Records: "dev/arch_decision.md"
- Code Reference:
- "dev/code_reference/index.md"
Expand Down
36 changes: 18 additions & 18 deletions nautobot_firewall_models/api/serializers.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""API serializers for firewall models."""
"""API serializers for nautobot_firewall_models."""

from nautobot.apps.api import NautobotModelSerializer, ValidatedModelSerializer
from nautobot.apps.api import NautobotModelSerializer, TaggedModelSerializerMixin, ValidatedModelSerializer
from rest_framework import serializers

from nautobot_firewall_models import models


class IPRangeSerializer(NautobotModelSerializer):
class IPRangeSerializer(NautobotModelSerializer, TaggedModelSerializerMixin): # pylint: disable=too-many-ancestors
"""IPRange Serializer."""

start_address = serializers.CharField()
Expand Down Expand Up @@ -49,7 +49,7 @@ def validate(self, data):
return super().validate(data)


class FQDNSerializer(NautobotModelSerializer):
class FQDNSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""FQDN Serializer."""

class Meta:
Expand All @@ -59,7 +59,7 @@ class Meta:
fields = "__all__"


class AddressObjectSerializer(NautobotModelSerializer):
class AddressObjectSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""AddressObject Serializer."""

class Meta:
Expand All @@ -69,7 +69,7 @@ class Meta:
fields = "__all__"


class AddressObjectGroupSerializer(NautobotModelSerializer):
class AddressObjectGroupSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""AddressObjectGroup Serializer."""

class Meta:
Expand All @@ -79,7 +79,7 @@ class Meta:
fields = "__all__"


class ApplicationObjectSerializer(NautobotModelSerializer):
class ApplicationObjectSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""ApplicationObject Serializer."""

class Meta:
Expand All @@ -89,7 +89,7 @@ class Meta:
fields = "__all__"


class ApplicationObjectGroupSerializer(NautobotModelSerializer):
class ApplicationObjectGroupSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""ApplicationObjectGroup Serializer."""

class Meta:
Expand All @@ -99,7 +99,7 @@ class Meta:
fields = "__all__"


class ServiceObjectSerializer(NautobotModelSerializer):
class ServiceObjectSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""ServiceObject Serializer."""

class Meta:
Expand All @@ -109,7 +109,7 @@ class Meta:
fields = "__all__"


class ServiceObjectGroupSerializer(NautobotModelSerializer):
class ServiceObjectGroupSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""ServiceObjectGroup Serializer."""

class Meta:
Expand All @@ -119,7 +119,7 @@ class Meta:
fields = "__all__"


class UserObjectSerializer(NautobotModelSerializer):
class UserObjectSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""UserObject Serializer."""

class Meta:
Expand All @@ -129,7 +129,7 @@ class Meta:
fields = "__all__"


class UserObjectGroupSerializer(NautobotModelSerializer):
class UserObjectGroupSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""UserObjectGroup Serializer."""

class Meta:
Expand All @@ -139,7 +139,7 @@ class Meta:
fields = "__all__"


class ZoneSerializer(NautobotModelSerializer):
class ZoneSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""Zone Serializer."""

class Meta:
Expand All @@ -149,7 +149,7 @@ class Meta:
fields = "__all__"


class PolicyRuleSerializer(NautobotModelSerializer):
class PolicyRuleSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""PolicyRule Serializer."""

index = serializers.IntegerField(required=False, default=None)
Expand All @@ -161,7 +161,7 @@ class Meta:
fields = "__all__"


class PolicySerializer(NautobotModelSerializer):
class PolicySerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""Policy Serializer."""

class Meta:
Expand All @@ -171,7 +171,7 @@ class Meta:
fields = "__all__"


class NATPolicyRuleSerializer(NautobotModelSerializer):
class NATPolicyRuleSerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""PolicyRule Serializer."""

class Meta:
Expand All @@ -181,7 +181,7 @@ class Meta:
fields = "__all__"


class NATPolicySerializer(NautobotModelSerializer):
class NATPolicySerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""NATPolicy Serializer."""

class Meta:
Expand All @@ -191,7 +191,7 @@ class Meta:
fields = "__all__"


class CapircaPolicySerializer(NautobotModelSerializer):
class CapircaPolicySerializer(NautobotModelSerializer, TaggedModelSerializerMixin):
"""CapircaPolicy Serializer."""

class Meta:
Expand Down
3 changes: 2 additions & 1 deletion nautobot_firewall_models/api/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Django API urlpatterns declaration for firewall model app."""
"""Django API urlpatterns declaration for nautobot_firewall_models app."""

from nautobot.apps.api import OrderedDefaultRouter

from nautobot_firewall_models.api import views

router = OrderedDefaultRouter()
# add the name of your api endpoint, usually hyphenated model name in plural, e.g. "my-model-classes"
router.register("address-object", views.AddressObjectViewSet)
router.register("address-object-group", views.AddressObjectGroupViewSet)
router.register("application-object", views.ApplicationObjectViewSet)
Expand Down
2 changes: 1 addition & 1 deletion nautobot_firewall_models/api/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""API views for firewall models."""
"""API views for nautobot_firewall_models."""

from nautobot.apps.api import ModelViewSet, NautobotModelViewSet

Expand Down
Loading

0 comments on commit c4f8c0c

Please sign in to comment.