aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-12-22 17:33:05 +0800
committerAaron LI <aly@aaronly.me>2018-12-22 17:33:05 +0800
commitcb594451580fd482d5654f1155735c1cfe2d2ab4 (patch)
tree487cbbd7a263626750fd0a91a1c22ad3d5b1ba5d
parentb99282c694026db027b8c7b8e889f9e279ffbc90 (diff)
downloadfg21sim-cb594451580fd482d5654f1155735c1cfe2d2ab4.tar.bz2
configs/manager: Tweak a bit
-rw-r--r--fg21sim/configs/manager.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py
index 6c50702..4b7f1e8 100644
--- a/fg21sim/configs/manager.py
+++ b/fg21sim/configs/manager.py
@@ -360,11 +360,10 @@ class ConfigManager:
If validated to be *valid*, the input key-value pair is then *merged*
into the configurations, otherwise, a ``ConfigError`` raised.
- NOTE/XXX
- --------
+ NOTE
+ ----
Given a ``ConfigObj`` instance with an option that does NOT exist in
- the specifications, it will simply *pass* the validation against the
- specifications.
+ the specifications, it will simply *pass* the validation.
There seems no way to prevent the ``Validator`` from accepting the
config options that does NOT exist in the specification.
Therefore, try to get the option value specified by the input key
@@ -413,7 +412,7 @@ class ConfigManager:
val_new = reduce(operator.getitem, key, config_new)
d2 = reduce(lambda x, y: {y: x}, reversed(key), val_new)
self.merge(d2)
- logger.info("Set config: {key}: {val_new} <- {val_old}".format(
+ logger.info("Set config: {key}: {val_old} -> {val_new}".format(
key="/".join(key), val_new=val_new, val_old=val_old))
def __getitem__(self, key):