94e1597978
When NagiosRunnerPlugin has no commands configured, set skip_reason before returning False from initialize(). This allows PluginLoader to log INFO (not WARNING) when the plugin is skipped. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
490 B
Python
23 lines
490 B
Python
import asyncio
|
|
import logging
|
|
import os
|
|
import stat
|
|
|
|
import pytest
|
|
|
|
from hbd.client.plugins.nagios_runner import (
|
|
NagiosRunnerPlugin,
|
|
NAGIOS_OK,
|
|
NAGIOS_WARNING,
|
|
NAGIOS_CRITICAL,
|
|
NAGIOS_UNKNOWN,
|
|
)
|
|
|
|
|
|
def test_no_commands_sets_skip_reason():
|
|
plugin = NagiosRunnerPlugin(config={"commands": []})
|
|
result = asyncio.run(plugin.initialize())
|
|
assert result is False
|
|
assert plugin.skip_reason is not None
|
|
assert "nagios_runner.commands" in plugin.skip_reason
|