Skip to content

Commit

Permalink
Merge pull request #123 from WhaleJ84/dev
Browse files Browse the repository at this point in the history
urlencode slashes on interface names
  • Loading branch information
WhaleJ84 authored Sep 1, 2022
2 parents 5d7ab21 + b9d4836 commit e094671
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Thank you for wanting to contribute to the project!
`librenms_handler` has no complex logic behind it - all you need to do is read the [API docs](https://docs.librenms.org/API/) and follow the existing code structure.

When you are ready to create a pull request for your contributions, please pull them into the `stage` branch, **not** `main`.
Merging into stage allows me to test the code before officially including it in the PyPI package.
When you are ready to create a pull request for your contributions, please pull them into the `dev` branch, **not** `main`.
Merging into dev allows me to test the code before officially including it in the PyPI package.

Alongside the documentation, there are the following design considerations to follow when contributing.

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ build-backend = "setuptools.build_meta"
[tool.pylint.FORMAT]
max-line-length=120
min-similarity-lines=5

[tool.pylint.'MESSAGES CONTROL']
disable=['W3101']
2 changes: 2 additions & 0 deletions src/librenms_handler/devices/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ def get_port_stats_by_port_hostname(
:param columns: Comma separated list of columns you want returned
"""
parameters = dict({"columns": columns})
interface_name = interface_name.replace('/', '%2F')
return get(
f"{self.url}/{device}/ports/{interface_name}",
parameters,
Expand Down Expand Up @@ -413,6 +414,7 @@ def get_graph_by_port_hostname( # pylint: disable=R0913
"ifDescr": interface_description,
}
)
interface_name = interface_name.replace('/', '%2F')
return get(
f"{self.url}/{device}/ports/{interface_name}/{port_type}",
parameters,
Expand Down

0 comments on commit e094671

Please sign in to comment.