summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2017-02-09 07:25:52 +0700
committerDaniil Baturin <daniil@baturin.org>2017-02-09 07:25:52 +0700
commitb7bbf381b785a58bd0903d9c6106fde305148edc (patch)
treeab5ee0f0e86ee357aa0ef199c37c8b24f3b8c59e /src
parent12ea26cdd1f717b1204d42dcdd4612b4bf1b17a1 (diff)
downloadvyconf-b7bbf381b785a58bd0903d9c6106fde305148edc.tar.gz
vyconf-b7bbf381b785a58bd0903d9c6106fde305148edc.zip
Revert "Add basepath option to the vyconfd config."
Basepath is better be a command line option, since when it's really needed, having it in the config is pretty much useless. This reverts commit 377de9472716266bb932813a8f7a7ba9aa1630fb.
Diffstat (limited to 'src')
-rw-r--r--src/vyconf_config.ml19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/vyconf_config.ml b/src/vyconf_config.ml
index 9301f84..7a87c1a 100644
--- a/src/vyconf_config.ml
+++ b/src/vyconf_config.ml
@@ -49,24 +49,21 @@ let optional_field default conf table field =
let value = get_field conf table field in
BatOption.default default value
-let (+/) l r = FilePath.concat l r
-
let load filename =
try
let open Defaults in
let conf_toml = Toml.Parser.from_filename filename |> Toml.Parser.unsafe in
- let basepath = optional_field "" conf_toml "appliance" "basepath" in
let conf = empty_config in
(* Mandatory fields *)
- let conf = {conf with app_name = basepath +/ (mandatory_field conf_toml "appliance" "name")} in
- let conf = {conf with data_dir = basepath +/ (mandatory_field conf_toml "appliance" "data_dir")} in
- let conf = {conf with config_dir = basepath +/ (mandatory_field conf_toml "appliance" "config_dir")} in
- let conf = {conf with program_dir = basepath +/ (mandatory_field conf_toml "appliance" "program_dir")} in
- let conf = {conf with primary_config = basepath +/ (mandatory_field conf_toml "appliance" "primary_config")} in
- let conf = {conf with fallback_config = basepath +/ (mandatory_field conf_toml "appliance" "fallback_config")} in
+ let conf = {conf with app_name = mandatory_field conf_toml "appliance" "name"} in
+ let conf = {conf with data_dir = mandatory_field conf_toml "appliance" "data_dir"} in
+ let conf = {conf with config_dir = mandatory_field conf_toml "appliance" "config_dir"} in
+ let conf = {conf with program_dir = mandatory_field conf_toml "appliance" "program_dir"} in
+ let conf = {conf with primary_config = mandatory_field conf_toml "appliance" "primary_config"} in
+ let conf = {conf with fallback_config = mandatory_field conf_toml "appliance" "fallback_config"} in
(* Optional fields *)
- let conf = {conf with pid_file = basepath +/ (optional_field defaults.pid_file conf_toml "vyconf" "pid_file")} in
- let conf = {conf with socket = basepath +/ (optional_field defaults.socket conf_toml "vyconf" "socket")} in
+ let conf = {conf with pid_file = optional_field defaults.pid_file conf_toml "vyconf" "pid_file"} in
+ let conf = {conf with socket = optional_field defaults.socket conf_toml "vyconf" "socket"} in
let conf = {conf with log_template = optional_field defaults.log_template conf_toml "vyconf" "log_template"} in
let conf = {conf with log_level = optional_field defaults.log_level conf_toml "vyconf" "log_level"} in
(* log_file is already string option, so we don't need to unwrap *)