Skip to content

Commit

Permalink
fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 committed Jan 21, 2023
1 parent 8713dd1 commit 082693b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/initializers/cables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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

Expand Down
10 changes: 6 additions & 4 deletions netbox_acls/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def validate(self, data):

# 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"
Expand Down Expand Up @@ -167,15 +168,16 @@ def get_assigned_object(self, obj):

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"
Expand Down Expand Up @@ -255,7 +257,7 @@ class Meta:

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.
"""
Expand Down Expand Up @@ -324,7 +326,7 @@ class Meta:

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.
Expand Down
8 changes: 4 additions & 4 deletions netbox_acls/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 082693b

Please sign in to comment.