serverwatcher 5.20__tar.gz → 5.21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {serverwatcher-5.20/src/serverwatcher.egg-info → serverwatcher-5.21}/PKG-INFO +1 -1
- {serverwatcher-5.20 → serverwatcher-5.21}/pyproject.toml +1 -1
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher/configclasses/watcher.py +0 -6
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher/defaultconfigs/watcher.yaml +0 -4
- serverwatcher-5.21/src/serverwatcher/validator.py +218 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher/watcher.py +0 -13
- {serverwatcher-5.20 → serverwatcher-5.21/src/serverwatcher.egg-info}/PKG-INFO +1 -1
- serverwatcher-5.20/src/serverwatcher/validator.py +0 -139
- {serverwatcher-5.20 → serverwatcher-5.21}/LICENSE +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/README.md +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/setup.cfg +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher/__init__.py +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher/__main__.py +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher/configclasses/__init__.py +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher/configclasses/config.py +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher/configclasses/messages.py +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher/defaultconfigs/config.yaml +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher/defaultconfigs/messages.yaml +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher.egg-info/SOURCES.txt +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher.egg-info/dependency_links.txt +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher.egg-info/requires.txt +0 -0
- {serverwatcher-5.20 → serverwatcher-5.21}/src/serverwatcher.egg-info/top_level.txt +0 -0
|
@@ -7,9 +7,6 @@ class WatcherConfig:
|
|
|
7
7
|
|
|
8
8
|
watch_interval: int = 'watch_interval'
|
|
9
9
|
|
|
10
|
-
schedule_control: bool = 'schedule_control.enabled'
|
|
11
|
-
restart_soon_id: int = 'schedule_control.restart_soon_id'
|
|
12
|
-
|
|
13
10
|
threshold_ram: int = 'thresholds.ram'
|
|
14
11
|
threshold_cpu: int = 'thresholds.cpu'
|
|
15
12
|
threshold_uptime: int = 'thresholds.uptime'
|
|
@@ -39,9 +36,6 @@ class WatcherConfig:
|
|
|
39
36
|
class fallbacks:
|
|
40
37
|
watch_interval = 300
|
|
41
38
|
|
|
42
|
-
schedule_control = False
|
|
43
|
-
restart_soon_id = 0
|
|
44
|
-
|
|
45
39
|
threshold_ram = 6
|
|
46
40
|
threshold_cpu = 150
|
|
47
41
|
threshold_uptime = 12
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from dataclasses import fields
|
|
3
|
+
|
|
4
|
+
from hungerlib import utils, loadConfig
|
|
5
|
+
|
|
6
|
+
from serverwatcher.configclasses.config import GlobalConfig
|
|
7
|
+
from serverwatcher.configclasses.messages import MessagesConfig
|
|
8
|
+
from serverwatcher.configclasses.watcher import WatcherConfig
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
utils.clearTerminal()
|
|
12
|
+
errors = []
|
|
13
|
+
warnings = []
|
|
14
|
+
defaults = []
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def validate_key_types(config_obj, schema):
|
|
18
|
+
for f in fields(schema):
|
|
19
|
+
if f.name.startswith("__"):
|
|
20
|
+
continue
|
|
21
|
+
|
|
22
|
+
expected_type = f.type
|
|
23
|
+
value = getattr(config_obj, f.name, None)
|
|
24
|
+
|
|
25
|
+
# allow None (missing + no fallback) to be handled by other validators
|
|
26
|
+
if value is None:
|
|
27
|
+
continue
|
|
28
|
+
|
|
29
|
+
if not isinstance(value, expected_type):
|
|
30
|
+
errors.append(
|
|
31
|
+
f'{schema.__name__}.{f.name}: expected {expected_type.__name__}, '
|
|
32
|
+
f'got "{type(value).__name__}" ({value!r})'
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def check_field(config_obj, name, allow_fallback=True):
|
|
37
|
+
"""
|
|
38
|
+
Unified check for:
|
|
39
|
+
- missing YAML key (config.raw.<name> is None)
|
|
40
|
+
- fallback usage (config.<name> == config.fallbacks.<name>)
|
|
41
|
+
- whether fallback is allowed or not
|
|
42
|
+
"""
|
|
43
|
+
raw = config_obj.raw
|
|
44
|
+
fb = config_obj.fallbacks
|
|
45
|
+
|
|
46
|
+
val = getattr(config_obj, name)
|
|
47
|
+
raw_val = getattr(raw, name)
|
|
48
|
+
fb_val = getattr(fb, name)
|
|
49
|
+
|
|
50
|
+
# 1) YAML key missing
|
|
51
|
+
if raw_val is None:
|
|
52
|
+
if allow_fallback:
|
|
53
|
+
warnings.append(f'{name}: key does not exist, using fallback "{fb_val}"')
|
|
54
|
+
else:
|
|
55
|
+
errors.append(f'{name}: key does not exist and fallback is not allowed')
|
|
56
|
+
return
|
|
57
|
+
|
|
58
|
+
# 2) YAML key exists but value equals fallback
|
|
59
|
+
if val == fb_val and not allow_fallback:
|
|
60
|
+
defaults.append(f'{name}: must not be left default or empty (got "{val}")')
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def validate_global_config(config):
|
|
64
|
+
c = config
|
|
65
|
+
|
|
66
|
+
# Fallback policy:
|
|
67
|
+
# - NOT allowed (must be set by user): panel_url, panel_api_key,
|
|
68
|
+
# server_id, server_domain, bridge_token
|
|
69
|
+
# - Allowed: everything else
|
|
70
|
+
|
|
71
|
+
# timezone
|
|
72
|
+
check_field(c, "timezone")
|
|
73
|
+
if c.timezone == "":
|
|
74
|
+
errors.append('timezone: must not be empty')
|
|
75
|
+
|
|
76
|
+
# panel
|
|
77
|
+
check_field(c, "panel_name")
|
|
78
|
+
check_field(c, "panel_url", allow_fallback=False)
|
|
79
|
+
check_field(c, "panel_api_key", allow_fallback=False)
|
|
80
|
+
|
|
81
|
+
if c.panel_url and not (c.panel_url.startswith("http://") or c.panel_url.startswith("https://")):
|
|
82
|
+
errors.append(f'panel_url: must start with "http://" or "https://" (got "{c.panel_url}")')
|
|
83
|
+
|
|
84
|
+
if c.panel_api_key and not c.panel_api_key.startswith("ptlc_"):
|
|
85
|
+
errors.append(f'panel_api_key: must be a valid Pterodactyl client API key (got "{c.panel_api_key}")')
|
|
86
|
+
if c.panel_api_key and c.panel_api_key.startswith("plta_"):
|
|
87
|
+
errors.append(f'panel_api_key: should not be an application key (got "{c.panel_api_key}")')
|
|
88
|
+
|
|
89
|
+
# server
|
|
90
|
+
check_field(c, "server_name")
|
|
91
|
+
check_field(c, "server_id", allow_fallback=False)
|
|
92
|
+
check_field(c, "server_domain", allow_fallback=False)
|
|
93
|
+
check_field(c, "server_port")
|
|
94
|
+
if c.server_domain and (c.server_domain.startswith("http://") or c.server_domain.startswith("https://")):
|
|
95
|
+
errors.append(f'server_domain: must not contain protocol (got "{c.server_domain}")')
|
|
96
|
+
if c.server_port is not None and not (1 <= c.server_port <= 65535):
|
|
97
|
+
errors.append(f'server_port: must be 1–65535 (got "{c.server_port}")')
|
|
98
|
+
|
|
99
|
+
# tps_command
|
|
100
|
+
check_field(c, "tps_command")
|
|
101
|
+
|
|
102
|
+
# hungerbridge
|
|
103
|
+
check_field(c, "bridge_token", allow_fallback=False)
|
|
104
|
+
check_field(c, "bridge_port")
|
|
105
|
+
if c.bridge_port is not None and not (1 <= c.bridge_port <= 65535):
|
|
106
|
+
errors.append(f'bridge_port: must be 1–65535 (got "{c.bridge_port}")')
|
|
107
|
+
|
|
108
|
+
# logger
|
|
109
|
+
check_field(c, "enable_logging")
|
|
110
|
+
check_field(c, "logger_name")
|
|
111
|
+
check_field(c, "log_path")
|
|
112
|
+
check_field(c, "info_prefix")
|
|
113
|
+
check_field(c, "warn_prefix")
|
|
114
|
+
check_field(c, "error_prefix")
|
|
115
|
+
|
|
116
|
+
# terminal
|
|
117
|
+
check_field(c, "clear_terminal")
|
|
118
|
+
check_field(c, "handle_keyboard_interrupt")
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def validate_watcher_config(watcherconfig):
|
|
122
|
+
c = watcherconfig
|
|
123
|
+
raw = c.raw
|
|
124
|
+
fb = c.fallbacks
|
|
125
|
+
|
|
126
|
+
# basic numeric sanity
|
|
127
|
+
if c.restart_wait_seconds <= 0:
|
|
128
|
+
errors.append(f'restart_wait_seconds: must be > 0 (got {c.restart_wait_seconds})')
|
|
129
|
+
|
|
130
|
+
if c.threshold_cpu <= 0:
|
|
131
|
+
errors.append(f'threshold_cpu: must be > 0 (got {c.threshold_cpu})')
|
|
132
|
+
|
|
133
|
+
if c.threshold_ram <= 0:
|
|
134
|
+
errors.append(f'threshold_ram: must be > 0 (got {c.threshold_ram})')
|
|
135
|
+
|
|
136
|
+
if c.threshold_tps <= 0 or c.threshold_tps > 20:
|
|
137
|
+
errors.append(f'threshold_tps: must be 1–20 (got {c.threshold_tps})')
|
|
138
|
+
|
|
139
|
+
# snap_minutes: must be a non-empty list of ints 0–59
|
|
140
|
+
if raw.snap_minutes is None:
|
|
141
|
+
warnings.append(f'snap_minutes: key does not exist, using fallback "{fb.snap_minutes}"')
|
|
142
|
+
|
|
143
|
+
if not isinstance(c.snap_minutes, list) or not c.snap_minutes:
|
|
144
|
+
errors.append(f'snap_minutes: must be a non-empty list of minute marks (got {c.snap_minutes!r})')
|
|
145
|
+
else:
|
|
146
|
+
bad = [m for m in c.snap_minutes if not isinstance(m, int) or not (0 <= m <= 59)]
|
|
147
|
+
if bad:
|
|
148
|
+
errors.append(f'snap_minutes: all values must be integers 0–59 (bad values: {bad})')
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def validate_messages_config(messages):
|
|
152
|
+
pass
|
|
153
|
+
# m = messages
|
|
154
|
+
|
|
155
|
+
# for f in fields(MessagesConfig):
|
|
156
|
+
# if f.name.startswith("__"):
|
|
157
|
+
# continue
|
|
158
|
+
# value = getattr(m, f.name)
|
|
159
|
+
# if not isinstance(value, str) or value.strip() == "":
|
|
160
|
+
# errors.append(f'MessagesConfig.{f.name}: must be a non-empty string')
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def validate_all():
|
|
164
|
+
config = loadConfig(GlobalConfig)
|
|
165
|
+
messages = loadConfig(MessagesConfig)
|
|
166
|
+
watcherconfig = loadConfig(WatcherConfig)
|
|
167
|
+
|
|
168
|
+
# type checks
|
|
169
|
+
validate_key_types(config, GlobalConfig)
|
|
170
|
+
validate_key_types(messages, MessagesConfig)
|
|
171
|
+
validate_key_types(watcherconfig, WatcherConfig)
|
|
172
|
+
|
|
173
|
+
# semantic checks
|
|
174
|
+
validate_global_config(config)
|
|
175
|
+
validate_watcher_config(watcherconfig)
|
|
176
|
+
validate_messages_config(messages)
|
|
177
|
+
|
|
178
|
+
# if too many critical defaults, assume "not configured at all"
|
|
179
|
+
critical_default_keys = [
|
|
180
|
+
"panel_url",
|
|
181
|
+
"panel_api_key",
|
|
182
|
+
"server_id",
|
|
183
|
+
"server_domain",
|
|
184
|
+
"bridge_token",
|
|
185
|
+
]
|
|
186
|
+
critical_defaults_used = [
|
|
187
|
+
d for d in defaults
|
|
188
|
+
if any(d.startswith(k) for k in critical_default_keys)
|
|
189
|
+
]
|
|
190
|
+
|
|
191
|
+
if len(critical_defaults_used) >= 3:
|
|
192
|
+
print('❌ CONFIG VALIDATION FAILED:\nIt looks like you haven\'t configured this yet! Please change these defaults:')
|
|
193
|
+
for d in critical_defaults_used:
|
|
194
|
+
print(' -', d)
|
|
195
|
+
sys.exit(1)
|
|
196
|
+
|
|
197
|
+
if errors or defaults:
|
|
198
|
+
print('❌ CONFIG VALIDATION FAILED:')
|
|
199
|
+
for e in errors:
|
|
200
|
+
print(' -', e)
|
|
201
|
+
for d in defaults:
|
|
202
|
+
print(' -', d)
|
|
203
|
+
if warnings:
|
|
204
|
+
print('\nWarnings:')
|
|
205
|
+
for w in warnings:
|
|
206
|
+
print(' -', w)
|
|
207
|
+
sys.exit(1)
|
|
208
|
+
|
|
209
|
+
if warnings:
|
|
210
|
+
print('⚠️ CONFIG VALIDATION WARNINGS:')
|
|
211
|
+
for w in warnings:
|
|
212
|
+
print(' -', w)
|
|
213
|
+
|
|
214
|
+
print('✅ All configs are valid.')
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
if __name__ == '__main__':
|
|
218
|
+
validate_all()
|
|
@@ -30,12 +30,6 @@ class ServerWatcher:
|
|
|
30
30
|
api_key=self.config.panel_api_key,
|
|
31
31
|
)
|
|
32
32
|
|
|
33
|
-
self.origin = servers.Generic(
|
|
34
|
-
name="Origin",
|
|
35
|
-
panel=self.panel,
|
|
36
|
-
server_id=self.config.origin_server_id
|
|
37
|
-
)
|
|
38
|
-
|
|
39
33
|
self.server = servers.Minecraft(
|
|
40
34
|
name=self.config.server_name,
|
|
41
35
|
panel=self.panel,
|
|
@@ -72,9 +66,6 @@ class ServerWatcher:
|
|
|
72
66
|
raise SystemExit
|
|
73
67
|
|
|
74
68
|
def restart_and_wait(self):
|
|
75
|
-
if self.watcherconfig.schedule_control:
|
|
76
|
-
self.origin.disableSchedule(self.watcherconfig.restart_soon_id)
|
|
77
|
-
|
|
78
69
|
self.server.restart()
|
|
79
70
|
self.router.info(self.messages.restart_action_sent)
|
|
80
71
|
time.sleep(self.watcherconfig.restart_wait_seconds)
|
|
@@ -143,10 +134,6 @@ class ServerWatcher:
|
|
|
143
134
|
restart_reasons = []
|
|
144
135
|
no_restart_reasons = []
|
|
145
136
|
|
|
146
|
-
if self.watcherconfig.schedule_control and self.server.getSchedule(self.watcherconfig.restart_soon_id)["is_active"]:
|
|
147
|
-
restart_reasons.append(self.messages.reason_restart_soon)
|
|
148
|
-
pro += self.watcherconfig.weight_restart_soon
|
|
149
|
-
|
|
150
137
|
if snap.ram >= self.watcherconfig.threshold_ram:
|
|
151
138
|
restart_reasons.append(mapit(self.messages.reason_ram, ram=snap.ram, threshold=self.watcherconfig.threshold_ram))
|
|
152
139
|
pro += int(round(snap.ram, 0) - (self.watcherconfig.threshold_ram - 1))
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
from dataclasses import fields
|
|
3
|
-
from hungerlib import utils, loadConfig
|
|
4
|
-
|
|
5
|
-
from serverwatcher.configclasses.config import GlobalConfig
|
|
6
|
-
from serverwatcher.configclasses.messages import MessagesConfig
|
|
7
|
-
from serverwatcher.configclasses.watcher import WatcherConfig
|
|
8
|
-
|
|
9
|
-
utils.clearTerminal()
|
|
10
|
-
|
|
11
|
-
def deep_get_attr(obj, dotted):
|
|
12
|
-
parts = dotted.split('.')
|
|
13
|
-
cur = obj
|
|
14
|
-
for p in parts:
|
|
15
|
-
if not hasattr(cur, p):
|
|
16
|
-
return None
|
|
17
|
-
cur = getattr(cur, p)
|
|
18
|
-
return cur
|
|
19
|
-
|
|
20
|
-
def validate_type(name, value, expected_type, errors):
|
|
21
|
-
if not isinstance(value, expected_type):
|
|
22
|
-
errors.append(f'{name}: expected {expected_type.__name__}, got {type(value).__name__}')
|
|
23
|
-
|
|
24
|
-
def validate_positive(name, value, errors):
|
|
25
|
-
if isinstance(value, (int, float)) and value < 0:
|
|
26
|
-
errors.append(f'{name}: must be >= 0 (got {value})')
|
|
27
|
-
|
|
28
|
-
def validate_nonempty(name, value, errors):
|
|
29
|
-
if isinstance(value, str) and value.strip() == '':
|
|
30
|
-
errors.append(f'{name}: cannot be empty')
|
|
31
|
-
|
|
32
|
-
def validate_dataclass(config_obj, schema, errors):
|
|
33
|
-
for f in fields(schema):
|
|
34
|
-
name = f.name
|
|
35
|
-
expected_type = f.type
|
|
36
|
-
value = deep_get_attr(config_obj, name)
|
|
37
|
-
|
|
38
|
-
validate_type(name, value, expected_type, errors)
|
|
39
|
-
|
|
40
|
-
if expected_type is str:
|
|
41
|
-
validate_nonempty(name, value, errors)
|
|
42
|
-
|
|
43
|
-
if expected_type in (int, float):
|
|
44
|
-
validate_positive(name, value, errors)
|
|
45
|
-
|
|
46
|
-
def validate_global_config(config, errors):
|
|
47
|
-
if config.server_port <= 0 or config.server_port > 65535:
|
|
48
|
-
errors.append(f'server_port: must be 1–65535 (got {config.server_port})')
|
|
49
|
-
|
|
50
|
-
if config.bridge_port <= 0 or config.bridge_port > 65535:
|
|
51
|
-
errors.append(f'bridge_port: must be 1–65535 (got {config.bridge_port})')
|
|
52
|
-
|
|
53
|
-
if len(config.bridge_token) < 8:
|
|
54
|
-
errors.append(f'bridge_token: must be 8 or more characters (got {config.bridge_token}, {len(config.bridge_token)} characters)')
|
|
55
|
-
|
|
56
|
-
def validate_watcher_config(watcherconfig, errors):
|
|
57
|
-
if watcherconfig.restart_wait_seconds < 1:
|
|
58
|
-
errors.append(f'restart_wait_seconds: must be > 0 (got {watcherconfig.restart_wait_seconds})')
|
|
59
|
-
|
|
60
|
-
if watcherconfig.threshold_cpu <= 0:
|
|
61
|
-
errors.append(f'threshold_cpu: must be > 0 (got {watcherconfig.threshold_cpu})')
|
|
62
|
-
|
|
63
|
-
if watcherconfig.threshold_ram <= 0:
|
|
64
|
-
errors.append(f'threshold_ram: must be > 0 (got {watcherconfig.threshold_ram})')
|
|
65
|
-
|
|
66
|
-
if watcherconfig.threshold_tps <= 0 or watcherconfig.threshold_tps > 20:
|
|
67
|
-
errors.append(f'threshold_tps: must be 1–20 (got {watcherconfig.threshold_tps})')
|
|
68
|
-
|
|
69
|
-
def validate_messages_config(messages, errors):
|
|
70
|
-
for f in fields(MessagesConfig):
|
|
71
|
-
value = getattr(messages, f.name)
|
|
72
|
-
if isinstance(value, str) and '{prefix}' not in value:
|
|
73
|
-
pass
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
# fallback detection
|
|
77
|
-
def ensure_no_global_defaults(config, defaults):
|
|
78
|
-
fb = config.fallbacks
|
|
79
|
-
|
|
80
|
-
if config.panel_url == fb.panel_url:
|
|
81
|
-
defaults.append('panel_url')
|
|
82
|
-
|
|
83
|
-
if config.panel_api_key == fb.panel_api_key:
|
|
84
|
-
defaults.append('panel_api_key')
|
|
85
|
-
|
|
86
|
-
if config.server_id == fb.server_id:
|
|
87
|
-
defaults.append('server_id')
|
|
88
|
-
|
|
89
|
-
if config.server_domain == fb.server_domain:
|
|
90
|
-
defaults.append('server_domain')
|
|
91
|
-
|
|
92
|
-
if config.bridge_token == fb.bridge_token:
|
|
93
|
-
defaults.append('bridge_token')
|
|
94
|
-
|
|
95
|
-
def ensure_no_watcher_defaults(watcherconfig, defaults):
|
|
96
|
-
fb = watcherconfig.fallbacks
|
|
97
|
-
|
|
98
|
-
if watcherconfig.schedule_control and watcherconfig.restart_soon_id == fb.restart_soon_id:
|
|
99
|
-
defaults.append('restart_soon_id')
|
|
100
|
-
|
|
101
|
-
# main validation entrypoint
|
|
102
|
-
def validate_all():
|
|
103
|
-
errors = []
|
|
104
|
-
defaults = []
|
|
105
|
-
|
|
106
|
-
config = loadConfig(GlobalConfig)
|
|
107
|
-
messages = loadConfig(MessagesConfig)
|
|
108
|
-
watcher = loadConfig(WatcherConfig)
|
|
109
|
-
|
|
110
|
-
validate_dataclass(config, GlobalConfig, errors)
|
|
111
|
-
validate_dataclass(messages, MessagesConfig, errors)
|
|
112
|
-
validate_dataclass(watcher, WatcherConfig, errors)
|
|
113
|
-
|
|
114
|
-
validate_global_config(config, errors)
|
|
115
|
-
validate_messages_config(messages, errors)
|
|
116
|
-
validate_watcher_config(watcher, errors)
|
|
117
|
-
|
|
118
|
-
ensure_no_global_defaults(config, defaults)
|
|
119
|
-
ensure_no_watcher_defaults(watcher, defaults)
|
|
120
|
-
|
|
121
|
-
if len(defaults) >= 5:
|
|
122
|
-
print('❌ CONFIG VALIDATION FAILED:\nIt looks like you haven\'t configured this yet! Please change these defaults:')
|
|
123
|
-
for d in defaults:
|
|
124
|
-
print(' -', d)
|
|
125
|
-
sys.exit(1)
|
|
126
|
-
|
|
127
|
-
if errors or defaults:
|
|
128
|
-
print('❌ CONFIG VALIDATION FAILED:')
|
|
129
|
-
for e in errors:
|
|
130
|
-
print(' -', e)
|
|
131
|
-
for d in defaults:
|
|
132
|
-
print(' -', d, ': must not be left default')
|
|
133
|
-
sys.exit(1)
|
|
134
|
-
|
|
135
|
-
print('✅ All configs are valid.')
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if __name__ == '__main__':
|
|
139
|
-
validate_all()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|