aboutsummaryrefslogtreecommitdiffstats
path: root/sdv/docs/docker/state/development/overview/settings.rst
diff options
context:
space:
mode:
authorParth Yadav <parth.yadav@ramanujan.du.ac.in>2020-08-07 18:16:54 +0530
committerParth Yadav <parth.yadav@ramanujan.du.ac.in>2020-08-17 19:11:14 +0530
commit69f4c631e49c359338cff5c9f5b2c96c6fe6b280 (patch)
treed7fc7e207aca6ae5b9899d1f1eba27fe29c4c273 /sdv/docs/docker/state/development/overview/settings.rst
parent42af6fa2ef682d28d12952831aa0c74fd647daad (diff)
Init SDV-State
This patch adds post cloud-software deployment state validation tool. Currently supports pod_health_check for Airship deployment. Signed-off-by: Parth Yadav<parthyadav3105@gmail.com> Change-Id: I28eeff520f7a00419620bf50cc38fd4793aa31b8
Diffstat (limited to 'sdv/docs/docker/state/development/overview/settings.rst')
-rw-r--r--sdv/docs/docker/state/development/overview/settings.rst38
1 files changed, 38 insertions, 0 deletions
diff --git a/sdv/docs/docker/state/development/overview/settings.rst b/sdv/docs/docker/state/development/overview/settings.rst
new file mode 100644
index 0000000..c70f21e
--- /dev/null
+++ b/sdv/docs/docker/state/development/overview/settings.rst
@@ -0,0 +1,38 @@
+Program Settings handler
+------------------------
+
+``from tools.conf import settings``
+
+Settings will be loaded from several ``.yaml`` or ``.yml`` files and any
+user provided settings files.
+
+So, that user can use these settings values across program.
+
+This utility loads settings from yaml files in form of key and value
+where key is always ``string`` while value can be of type python:
+
+- ``int`` e.g. 5, 45, 1234
+- ``str`` e.g. hello, world
+- ``float`` e.g. 34.56, 12.7
+- ``list`` e.g. [ ‘month’ , ‘is’, 45 ]
+- ``dict`` e.g. {‘program’: ‘sdv’, ‘language’: ‘python’}
+- ``bool`` e.g. True, False
+
+keys are case-insensitive
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The utility is case-insensitive to keys used as it automatically
+converts all keys to lower case.
+
+E.g. ``Program : sdv``, ``program : sdv``, ``PrOgRam : sdv`` all are
+same.
+
+- ``settings.load_from_file(path/to/file)``
+- ``settings.load_from_env()``
+- ``settings.load_from_dir(directory/to/search/yamls)``
+
+``settings.load_from_dir()`` reads all yaml files in given directory and
+all it’s sub-directory recursively in ascending order, hence if a
+configuration item exists in more than one file, then the setting in the
+file that occurs in the last read file will have high precedence and
+overwrite previous values. . \ No newline at end of file