-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add null detector (useful for testing and potentially later on
supporting ip updates without a dedicated dedection mechanism)
- Loading branch information
1 parent
50882e4
commit 4e13c3f
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import logging | ||
|
||
from .base import IPDetector | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
class IPDetector_Null(IPDetector): | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
infothrill
Author
Owner
|
||
"""Dummy IP detector.""" | ||
|
||
def __init__(self, family=None, *args, **kwargs): | ||
""" | ||
Initializer. | ||
:param family: IP address family (default: '' (ANY), also possible: 'INET', 'INET6') | ||
""" | ||
super(IPDetector_Null, self).__init__(*args, family=family, **kwargs) | ||
|
||
@staticmethod | ||
def names(): | ||
return ("null",) | ||
|
||
def can_detect_offline(self): | ||
"""Return true, as this detector generates no network traffic. | ||
:return: True | ||
""" | ||
return True | ||
|
||
def detect(self): | ||
""" | ||
Return None. | ||
:rtype: None | ||
""" | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove empty line?