Skip to content

Commit

Permalink
no proto-parsing in fetcher
Browse files Browse the repository at this point in the history
Let the parser parse!  duh!

Change-Id: Ib0888c03cf21eb7130a8e6e5d4dece0f8cd53c8c
  • Loading branch information
Synss committed Jul 6, 2023
1 parent 9ba5be1 commit 7d77b69
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions cmk/fetchers/_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import socket
import ssl
import sys
from collections.abc import Mapping, Sized
from collections.abc import Mapping
from typing import Any, Final

import cmk.utils.debug
Expand Down Expand Up @@ -174,7 +174,6 @@ def _fetch_from_io(self, mode: Mode) -> AgentRawData:
agent_data = self._get_agent_data(
str(controller_uuid) if controller_uuid is not None else None
)
self._validate_decrypted_data(agent_data)
return agent_data

def _from_tls(self, server_hostname: str) -> tuple[TransportProtocol, Buffer]:
Expand Down Expand Up @@ -243,9 +242,3 @@ def _get_agent_data(self, server_hostname: str | None) -> AgentRawData:
return AgentRawData(decrypt_by_agent_protocol(secret, protocol, output))
except Exception as e:
raise MKFetcherError("Failed to decrypt agent output: %r" % e) from e

def _validate_decrypted_data(self, output: Sized) -> None:
if len(output) < 16:
raise MKFetcherError(
f"Too short payload from agent at {self.address[0]}:{self.address[1]}: {output!r}"
)

0 comments on commit 7d77b69

Please sign in to comment.