|
45 | 45 | from cmk.base import default_config |
46 | 46 | from cmk.base.configlib.checkengine import CheckingConfig |
47 | 47 | from cmk.base.configlib.labels import LabelConfig |
| 48 | +from cmk.base.configlib.loaded_config import LoadedConfigFragment |
48 | 49 | from cmk.base.configlib.servicename import FinalServiceNameConfig, PassiveServiceNameConfig |
49 | 50 | from cmk.base.default_config import * # noqa: F403 |
50 | 51 | from cmk.base.parent_scan import ScanConfig as ParentScanConfig |
|
104 | 105 | from cmk.fetchers.config import make_persisted_section_dir |
105 | 106 | from cmk.fetchers.filecache import MaxAge |
106 | 107 | from cmk.piggyback import backend as piggyback_backend |
107 | | -from cmk.rrd.config import RRDObjectConfig # pylint: disable=cmk-module-layer-violation |
108 | 108 | from cmk.server_side_calls import v1 as server_side_calls_api |
109 | 109 | from cmk.server_side_calls_backend import ( |
110 | 110 | ActiveCheck, |
|
133 | 133 | from cmk.utils.experimental_config import load_experimental_config |
134 | 134 | from cmk.utils.host_storage import ( |
135 | 135 | apply_hosts_file_to_object, |
136 | | - FolderAttributesForBase, |
137 | 136 | get_host_storage_loaders, |
138 | 137 | ) |
139 | 138 | from cmk.utils.http_proxy_config import http_proxy_config_from_user_setting, HTTPProxyConfig |
|
186 | 185 | service_service_levels: list[RuleSpec[int]] = [] |
187 | 186 | host_service_levels: list[RuleSpec[int]] = [] |
188 | 187 |
|
189 | | -_AgentTargetVersion = None | str | tuple[str, str] | tuple[str, dict[str, str]] |
190 | | - |
191 | | -ShadowHosts = dict[HostName, dict[str, Any]] |
192 | 188 |
|
193 | 189 | ObjectMacros = dict[str, AnyStr] |
194 | 190 |
|
@@ -501,7 +497,6 @@ class CheckmkCheckParameters(NamedTuple): |
501 | 497 | ObjectAttributes = dict[str, Any] |
502 | 498 |
|
503 | 499 | GroupDefinitions = dict[str, str] |
504 | | -RecurringDowntime = Mapping[str, int | str] # TODO(sk): TypedDict here |
505 | 500 |
|
506 | 501 |
|
507 | 502 | class _NestedExitSpec(ExitSpec, total=False): |
@@ -550,86 +545,6 @@ def register(name: str, default_value: Any) -> None: |
550 | 545 | # '----------------------------------------------------------------------' |
551 | 546 |
|
552 | 547 |
|
553 | | -@dataclasses.dataclass(frozen=True, kw_only=True) |
554 | | -class LoadedConfigFragment: |
555 | | - """Return *some of* the values that have been loaded as part of the config loading process. |
556 | | -
|
557 | | - The config loading currently mostly manipulates a global state. |
558 | | - Return an instance of this class, to indicate that the config has been loaded. |
559 | | -
|
560 | | - Someday (TM): return the actual loaded config, at which point this class will be quite big |
561 | | - (compare cmk/base/default_config/base ...) |
562 | | - """ |
563 | | - |
564 | | - # TODO: get `HostAddress` VS. `str` right! Which is it at what point?! |
565 | | - # NOTE: all of the below is wishful typing, no parsing is done yet. |
566 | | - # for now we just copy what we find in default_config |
567 | | - folder_attributes: Mapping[str, FolderAttributesForBase] |
568 | | - discovery_rules: Mapping[RuleSetName, Sequence[RuleSpec]] |
569 | | - checkgroup_parameters: Mapping[str, Sequence[RuleSpec[Mapping[str, object]]]] |
570 | | - static_checks: Mapping[ |
571 | | - str, list[RuleSpec[list[object]]] |
572 | | - ] # a.k.a. "enforced_services". Keep the name for consistency |
573 | | - service_rule_groups: set[str] |
574 | | - service_descriptions: Mapping[str, str] |
575 | | - service_description_translation: Sequence[RuleSpec[Mapping[str, object]]] |
576 | | - use_new_descriptions_for: Container[str] |
577 | | - monitoring_core: Literal["nagios", "cmc"] |
578 | | - nagios_illegal_chars: str |
579 | | - cmc_illegal_chars: str |
580 | | - all_hosts: Sequence[str] |
581 | | - clusters: Mapping[HostAddress, Sequence[HostAddress]] |
582 | | - shadow_hosts: ShadowHosts |
583 | | - service_dependencies: Sequence[tuple] |
584 | | - fallback_agent_output_encoding: str |
585 | | - agent_config: Mapping[str, Sequence[RuleSpec]] |
586 | | - agent_port: int |
587 | | - agent_ports: Sequence[RuleSpec[int]] |
588 | | - tcp_connect_timeout: float |
589 | | - tcp_connect_timeouts: Sequence[RuleSpec[float]] |
590 | | - encryption_handling: Sequence[RuleSpec[Mapping[str, str]]] |
591 | | - piggyback_translation: Sequence[RuleSpec[Mapping[str, object]]] |
592 | | - agent_encryption: Sequence[RuleSpec[str | None]] |
593 | | - agent_exclude_sections: Sequence[RuleSpec[dict[str, str]]] |
594 | | - cmc_real_time_checks: RealTimeChecks | None |
595 | | - snmp_check_interval: list[ |
596 | | - RuleSpec[ |
597 | | - tuple[list[str], tuple[Literal["cached"], float] | tuple[Literal["uncached"], None]] |
598 | | - ] |
599 | | - ] |
600 | | - apply_bake_revision: bool |
601 | | - bake_agents_on_restart: bool |
602 | | - agent_bakery_logging: int | None |
603 | | - is_wato_slave_site: bool |
604 | | - simulation_mode: bool |
605 | | - use_dns_cache: bool |
606 | | - ipaddresses: Mapping[HostName, HostAddress] |
607 | | - ipv6addresses: Mapping[HostName, HostAddress] |
608 | | - fake_dns: str | None |
609 | | - tag_config: cmk.utils.tags.TagConfigSpec |
610 | | - host_tags: ruleset_matcher.TagsOfHosts |
611 | | - cmc_log_rrdcreation: Literal["terse", "full"] | None |
612 | | - cmc_host_rrd_config: Sequence[RuleSpec[Any]] |
613 | | - host_recurring_downtimes: Sequence[RuleSpec[RecurringDowntime]] |
614 | | - cmc_flap_settings: tuple[float, float, float] |
615 | | - cmc_host_flap_settings: Sequence[RuleSpec[tuple[float, float, float]]] |
616 | | - cmc_host_long_output_in_monitoring_history: Sequence[RuleSpec[bool]] |
617 | | - host_state_translation: Sequence[RuleSpec[Mapping[str, object]]] |
618 | | - cmc_smartping_settings: Sequence[RuleSpec[Mapping[str, float]]] |
619 | | - cmc_service_rrd_config: Sequence[RuleSpec[RRDObjectConfig]] |
620 | | - service_recurring_downtimes: Sequence[RuleSpec[Mapping[str, int | str]]] |
621 | | - cmc_service_flap_settings: Sequence[RuleSpec[tuple[float, float, float]]] |
622 | | - cmc_service_long_output_in_monitoring_history: Sequence[RuleSpec[bool]] |
623 | | - service_state_translation: Sequence[RuleSpec[Mapping[str, object]]] |
624 | | - cmc_check_timeout: int |
625 | | - cmc_service_check_timeout: Sequence[RuleSpec[int]] |
626 | | - cmc_graphite_host_metrics: Sequence[RuleSpec[Sequence[str]]] |
627 | | - cmc_graphite_service_metrics: Sequence[RuleSpec[Sequence[str]]] |
628 | | - cmc_influxdb_service_metrics: Sequence[RuleSpec[Mapping[str, object]]] |
629 | | - cmc_log_levels: Mapping[str, int] |
630 | | - cluster_max_cachefile_age: int |
631 | | - |
632 | | - |
633 | 548 | @dataclasses.dataclass(frozen=True, kw_only=True) |
634 | 549 | class LoadingResult: |
635 | 550 | """Return the result of the config loading process. |
|
0 commit comments