fixed typos

This commit is contained in:
Abhimanyu Saharan 2023-01-21 14:20:20 +05:30
parent 8713dd165b
commit 082693b6d8
5 changed files with 19 additions and 17 deletions

View File

@ -3,7 +3,7 @@
# ```
# termination_x_name -> name of interface
# termination_x_device -> name of the device interface belongs to
# termination_x_class -> required if different than 'Interface' which is the default
# termination_x_class -> required if different from 'Interface' which is the default
# ```
#
# Supported termination classes: Interface, ConsolePort, ConsoleServerPort, FrontPort, RearPort, PowerPort, PowerOutlet

View File

@ -3,9 +3,9 @@
## Reporting Bugs
* First, ensure that you're running the [latest stable version](https://github.com/netbox-community/netbox/releases)
of NetBox or this plugin [latest stable version](https://github.com/ryanmerolle/netbox-acls/releases).
of NetBox or this plugin is at [latest stable version](https://github.com/ryanmerolle/netbox-acls/releases).
If you're running an older version, it's possible that the bug has already been fixed
or you are running a version of the plugin not tested with the NetBox version
or, you are running a version of the plugin not tested with the NetBox version
you are running [Compatibility Matrix](./README.md#compatibility).
* Next, check the GitHub [issues list](https://github.com/ryanmerolle/netbox-acls/issues)

View File

@ -19,7 +19,7 @@ Based on the NetBox plugin tutorial by [jeremystretch](https://github.com/jeremy
- [demo repository](https://github.com/netbox-community/netbox-plugin-demo)
- [tutorial](https://github.com/netbox-community/netbox-plugin-tutorial)
All credit should go to Jeremy. Thanks Jeremy!
All credit should go to Jeremy. Thanks, Jeremy!
This project just looks to build on top of this framework and model presented.
@ -69,12 +69,12 @@ PLUGINS_CONFIG = {
To develop this plugin further one can use the included .devcontainer configuration. This configuration creates a docker container which includes a fully working netbox installation. Currently it should work when using WSL 2. For this to work make sure you have Docker Desktop installed and the WSL 2 integrations activated.
1. In the WSL terminal, enter `code` to run Visual studio code.
1. Install the devcontainer extension "ms-vscode-remote.remote-containers"
1. Press Ctrl+Shift+P and use the "Dev Container: Clone Repository in Container Volume" function to clone this repository. This will take a while depending on your computer
1. If you'd like the netbox instance to be prepopulated run `make Makefile example_initializers` and `make Makefile load_initializers`
1. Start the netbox instance using `make Makefile all`
2. Install the devcontainer extension "ms-vscode-remote.remote-containers"
3. Press Ctrl+Shift+P and use the "Dev Container: Clone Repository in Container Volume" function to clone this repository. This will take a while depending on your computer
4. If you'd like the netbox instance to be prepopulated run `make Makefile example_initializers` and `make Makefile load_initializers`
5. Start the netbox instance using `make Makefile all`
Your netbox instance will be served under 0.0.0.0:8000 so it should now be available under localhost:8000.
Your netbox instance will be served under 0.0.0.0:8000, so it should now be available under localhost:8000.
## Screenshots

View File

@ -96,6 +96,7 @@ class AccessListSerializer(NetBoxModelSerializer):
# Check that the GFK object is valid.
if "assigned_object_type" in data and "assigned_object_id" in data:
# TODO: This can removed after https://github.com/netbox-community/netbox/issues/10221 is fixed.
try:
assigned_object = data[ # noqa: F841
"assigned_object_type"
@ -167,15 +168,16 @@ class ACLInterfaceAssignmentSerializer(NetBoxModelSerializer):
def validate(self, data):
"""
Validate the AccessList django model model's inputs before allowing it to update the instance.
Validate the AccessList django model's inputs before allowing it to update the instance.
- Check that the GFK object is valid.
- Check that the associated interface's parent host has the selected ACL defined.
"""
error_message = {}
acl_host = data["access_list"].assigned_object
# Check that the GFK object is vlaid.
# Check that the GFK object is valid.
if "assigned_object_type" in data and "assigned_object_id" in data:
# TODO: This can removed after https://github.com/netbox-community/netbox/issues/10221 is fixed.
try:
assigned_object = data[ # noqa: F841
"assigned_object_type"
@ -255,7 +257,7 @@ class ACLStandardRuleSerializer(NetBoxModelSerializer):
def validate(self, data):
"""
Validate the ACLStandardRule django model model's inputs before allowing it to update the instance:
Validate the ACLStandardRule django model's inputs before allowing it to update the instance:
- Check if action set to remark, but no remark set.
- Check if action set to remark, but source_prefix set.
"""
@ -324,7 +326,7 @@ class ACLExtendedRuleSerializer(NetBoxModelSerializer):
def validate(self, data):
"""
Validate the ACLExtendedRule django model model's inputs before allowing it to update the instance:
Validate the ACLExtendedRule django model's inputs before allowing it to update the instance:
- Check if action set to remark, but no remark set.
- Check if action set to remark, but source_prefix set.
- Check if action set to remark, but source_ports set.

View File

@ -90,7 +90,7 @@ class AccessListEditView(generic.ObjectEditView):
class AccessListDeleteView(generic.ObjectDeleteView):
"""
Defines the delete view for the AccessLists django model.
Defines delete view for the AccessLists django model.
"""
queryset = models.AccessList.objects.all()
@ -138,7 +138,7 @@ class ACLInterfaceAssignmentEditView(generic.ObjectEditView):
class ACLInterfaceAssignmentDeleteView(generic.ObjectDeleteView):
"""
Defines the delete view for the ACLInterfaceAssignments django model.
Defines delete view for the ACLInterfaceAssignments django model.
"""
queryset = models.ACLInterfaceAssignment.objects.all()
@ -185,7 +185,7 @@ class ACLStandardRuleEditView(generic.ObjectEditView):
class ACLStandardRuleDeleteView(generic.ObjectDeleteView):
"""
Defines the delete view for the ACLStandardRules django model.
Defines delete view for the ACLStandardRules django model.
"""
queryset = models.ACLStandardRule.objects.all()
@ -232,7 +232,7 @@ class ACLExtendedRuleEditView(generic.ObjectEditView):
class ACLExtendedRuleDeleteView(generic.ObjectDeleteView):
"""
Defines the delete view for the ACLExtendedRules django model.
Defines delete view for the ACLExtendedRules django model.
"""
queryset = models.ACLExtendedRule.objects.all()