Continuing the series of cleanup PRs, this one mostly moves and renames files with very little code impact past rewriting imports.
Move core.xsd out of the tests directory and rename it. It is now conpot/template.xsd, though it could be argued it should be conpot/core/template.xsd... but it's being used by bin/conpot and not technically by core. Either way it brings it more in line with the protocol XSDs like conpot/protocols/ftp/ftp.xsd. This removes conpot/tests/template_schemas/ where it was the only file.
Move Proxy from conpot.emulators.proxy to the more fitting conpot.protocols.proxy. Also merge conpot.protocols.misc.ascii_decoder.AsciiDecoder into conpot.protocols.proxy. This removes conpot.protocols.misc, where AsciiDecoder was the only module.
Unify conpot.helpers and conpot.utils. I think it's fine for either to exist but confusing for both to exist. This involves minimal code movement.
conpot.helpers is renamed conpot.utils.networking (I'm open for a better name here), except that is then longer an appropriate location for months_map, which is thus moved to conpot.core.filesystem, the only place it's being used.
get_interface_ip is moved from conpot.utils.ext_ip to the now more appropriate conpot.utils.networking.
Some logger test files were prefixed test_logger_, while others were not. They're now all in line. The same is done for test_utils_.
conpot.core.loggers.log_worker is not a logger and is thus promoted to conpot.core.log_worker. This one in particular is quite nit-picky.
If any of this proves controversial I can pull the offending commit. Only the kamstrup changes are a little intertwined.
Continuing the series of cleanup PRs, this one mostly moves and renames files with very little code impact past rewriting imports.
core.xsd
out of the tests directory and rename it. It is nowconpot/template.xsd
, though it could be argued it should beconpot/core/template.xsd
... but it's being used bybin/conpot
and not technically bycore
. Either way it brings it more in line with the protocol XSDs likeconpot/protocols/ftp/ftp.xsd
. This removesconpot/tests/template_schemas/
where it was the only file.Proxy
fromconpot.emulators.proxy
to the more fittingconpot.protocols.proxy
. Also mergeconpot.protocols.misc.ascii_decoder.AsciiDecoder
intoconpot.protocols.proxy
. This removesconpot.protocols.misc
, whereAsciiDecoder
was the only module.conpot.protocols.kamstrup.usage_simulator.UsageSimulator
fromprotocols
toemulators
. Its usage (heh) leads me to believe it's an emulator (sic) and thus belongs in the emulators directory. https://github.com/mushorg/conpot/blob/237b1563eeffc42c8741d5a078a2fa22b1dff772/conpot/templates/kamstrup_382/template.xml#L13-L15to
conpot.helpers
andconpot.utils
. I think it's fine for either to exist but confusing for both to exist. This involves minimal code movement.conpot.helpers
is renamedconpot.utils.networking
(I'm open for a better name here), except that is then longer an appropriate location formonths_map
, which is thus moved toconpot.core.filesystem
, the only place it's being used.get_interface_ip
is moved fromconpot.utils.ext_ip
to the now more appropriateconpot.utils.networking
.test_logger_
, while others were not. They're now all in line. The same is done fortest_utils_
.conpot.core.loggers.log_worker
is not a logger and is thus promoted toconpot.core.log_worker
. This one in particular is quite nit-picky.If any of this proves controversial I can pull the offending commit. Only the kamstrup changes are a little intertwined.