Skip to content

Commit

Permalink
Raise exception for missing router_pass in NetGear
Browse files Browse the repository at this point in the history
Upgrade gmail-connector and references
  • Loading branch information
dormant-user committed Apr 4, 2023
1 parent 0b1e2ad commit ff00de4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion netsec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from netsec.modules.models import SupportedModules # noqa: F401
from netsec.modules.settings import config # noqa: F401

version = "0.1.8"
version = "0.9"
9 changes: 6 additions & 3 deletions netsec/analyzer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import NoReturn

from gmailconnector.validator import address as email_address
import gmailconnector

from netsec.modules import att, models, netgear, settings

Expand All @@ -14,9 +14,12 @@ def network_monitor(module: models.SupportedModules, init: bool = True, block: b
block: Takes a boolean value whether to block the intrusive device.
"""
if settings.config.recipient:
email_address.logger = settings.LOGGER
settings.config.recipient = email_address.ValidateAddress(address=settings.config.recipient) # noqa
settings.config.recipient = gmailconnector.EmailAddress(address=settings.config.recipient)
if module == models.SupportedModules.netgear:
if not settings.config.router_pass:
raise ValueError(
"\n\n'router_pass' is required for NetGear routers"
)
if init:
netgear.LocalIPScan().create_snapshot()
else:
Expand Down
5 changes: 2 additions & 3 deletions netsec/modules/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@

import gmailconnector
import jinja2
from gmailconnector.responder import Response

from netsec.modules.settings import LOGGER, config


def _log_response(response: Response) -> NoReturn:
"""Log response from gmailconnector."""
def _log_response(response: gmailconnector.Response) -> NoReturn:
"""Log response from gmail-connector."""
if response.ok:
LOGGER.info(response.body)
return True
Expand Down
5 changes: 5 additions & 0 deletions release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Release Notes
=============

0.1.9 (04/03/2023)
------------------
- Raise exception for missing router_pass in NetGear
- Upgrade gmail-connector and references

0.1.8 (02/25/2023)
------------------
- Add LICENSE and update README.md and bump version
Expand Down

0 comments on commit ff00de4

Please sign in to comment.