summaryrefslogtreecommitdiff
path: root/kvmd/apps/__init__.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-04-28 08:31:37 +0300
committerDevaev Maxim <[email protected]>2019-04-28 08:31:37 +0300
commit0bde12e24ddb3aad02e9d39c031bb66b04bfd997 (patch)
treedfb3639a6b0f32242047677d580916ece046f7ba /kvmd/apps/__init__.py
parent380b1d15e3c8fcb7cc324cebf209bfe38cbb4011 (diff)
ipmi bmc proxy
Diffstat (limited to 'kvmd/apps/__init__.py')
-rw-r--r--kvmd/apps/__init__.py29
1 files changed, 25 insertions, 4 deletions
diff --git a/kvmd/apps/__init__.py b/kvmd/apps/__init__.py
index 65d30f2e..e4b10127 100644
--- a/kvmd/apps/__init__.py
+++ b/kvmd/apps/__init__.py
@@ -110,11 +110,13 @@ def _init_config(config_path: str, sections: List[str], override_options: List[s
_merge_dicts(raw_config, build_raw_from_options(override_options))
config = make_config(raw_config, scheme)
- scheme["kvmd"]["auth"]["internal"] = get_auth_service_class(config.kvmd.auth.internal_type).get_options()
- if config.kvmd.auth.external_type:
- scheme["kvmd"]["auth"]["external"] = get_auth_service_class(config.kvmd.auth.external_type).get_options()
+ if "kvmd" in sections:
+ scheme["kvmd"]["auth"]["internal"] = get_auth_service_class(config.kvmd.auth.internal_type).get_options()
+ if config.kvmd.auth.external_type:
+ scheme["kvmd"]["auth"]["external"] = get_auth_service_class(config.kvmd.auth.external_type).get_options()
+ config = make_config(raw_config, scheme)
- return make_config(raw_config, scheme)
+ return config
except (ConfigError, UnknownPluginError) as err:
raise SystemExit("Config error: %s" % (str(err)))
@@ -233,6 +235,25 @@ def _get_config_scheme(sections: List[str]) -> Dict:
"cmd": Option(["/bin/true"], type=valid_command),
},
},
+
+ "ipmi": {
+ "server": {
+ "host": Option("::", type=valid_ip_or_host),
+ "port": Option(623, type=valid_port),
+ "timeout": Option(10.0, type=valid_float_f01),
+ },
+
+ "kvmd": {
+ "host": Option("localhost", type=valid_ip_or_host, unpack_as="kvmd_host"),
+ "port": Option(0, type=valid_port, unpack_as="kvmd_port"),
+ "unix": Option("", type=valid_abs_path, only_if="!port", unpack_as="kvmd_unix_path"),
+ "timeout": Option(5.0, type=valid_float_f01, unpack_as="kvmd_timeout"),
+ },
+
+ "auth": {
+ "file": Option("/etc/kvmd/ipmipasswd", type=valid_abs_path_exists, unpack_as="path"),
+ },
+ },
}
if sections: