Skip to content

Commit

Permalink
Merge pull request #475 from phenobarbital/test-version
Browse files Browse the repository at this point in the history
bugfix converting logstash port to integer
  • Loading branch information
phenobarbital authored May 22, 2024
2 parents 113c1be + 8841abc commit 2929ebf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 5 additions & 2 deletions navconfig/logging/handlers/logstash.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ def __init__(self, config, loglevel, application: str) -> None:
"logstash_flush_timeout", section="logging", fallback=10
)
self.host = config.get("LOGSTASH_HOST", fallback=self.host)
self.port = config.get("LOGSTASH_PORT", fallback=self.port)
self.port = config.getint("LOGSTASH_PORT", fallback=self.port)

def logstash_available(self, timeout=5):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(timeout)
result = sock.connect_ex((self.host, self.port))
try:
result = sock.connect_ex((self.host, int(self.port)))
except TypeError:
return False
sock.close()
return result == 0

Expand Down
2 changes: 1 addition & 1 deletion navconfig/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Configuration tool for all Navigator Services "
"Tool for accessing Config info from different sources."
)
__version__ = "1.7.0"
__version__ = "1.7.1"
__author__ = "Jesus Lara"
__author_email__ = "jesuslarag@gmail.com"
__license__ = "MIT"
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ def readme():
"orjson==3.10.3",
'pycryptodomex==3.20.0',
"cryptography==42.0.4",
"aiofiles==23.2.1",
'aiofile==3.8.8',
"aiofiles==23.2.1"
],
extras_require={
"memcache": [
Expand Down

0 comments on commit 2929ebf

Please sign in to comment.