Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
amyasnikov committed Nov 16, 2024
1 parent f2bccc8 commit 621c62e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/features/custom_pollers.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ To define your own Poller, two steps must be performed:
Here is the minimal viable example of a custom poller class. It uses `scrapli` library to connect to devices via SSH.

```python
from scrapli import Scrapli
from validity.pollers import CustomPoller
from validity.models import Command

Expand Down
6 changes: 2 additions & 4 deletions validity/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ def validity_settings(django_settings: Annotated[LazySettings, django_settings])
@di.dependency(scope=Singleton)
def pollers_info(custom_pollers: Annotated[list[PollerInfo], "validity_settings.custom_pollers"]) -> list[PollerInfo]:
return [
PollerInfo(
klass=NetmikoPoller, name="netmiko", verbose_name="netmiko", color="blue", command_types=["CLI", "custom"]
),
PollerInfo(klass=NetmikoPoller, name="netmiko", verbose_name="netmiko", color="blue", command_types=["CLI"]),
PollerInfo(
klass=RequestsPoller, name="requests", verbose_name="requests", color="info", command_types=["json_api"]
),
Expand All @@ -37,7 +35,7 @@ def pollers_info(custom_pollers: Annotated[list[PollerInfo], "validity_settings.
name="scrapli_netconf",
verbose_name="scrapli_netconf",
color="orange",
command_types=["netconf", "custom"],
command_types=["netconf"],
),
] + custom_pollers

Expand Down

0 comments on commit 621c62e

Please sign in to comment.