Alon Bar-Lev has uploaded a new change for review.

Change subject: core: config: add enforce environment configuration
......................................................................

core: config: add enforce environment configuration

Change-Id: I50129b16d59a7ad8e1337fad9fc9b2cb650e8e0a
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M README
M src/otopi/constants.py
M src/plugins/otopi/core/config.py
3 files changed, 17 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/otopi refs/changes/59/10359/1

diff --git a/README b/README
index e6bb50c..e68d80d 100644
--- a/README
+++ b/README
@@ -78,9 +78,13 @@
     [environment:override]
     key=type:value
 
+    [environment:enforce]
+    key=type:value
+
 defaults is applied during setup without override.
 init is applied during setup with override.
 override is applied before customization with override.
+enforce is applied after customization with override.
 
 type ::= none | bool | int | str | multi-str
 
diff --git a/src/otopi/constants.py b/src/otopi/constants.py
index dc9b7e9..85879e7 100644
--- a/src/otopi/constants.py
+++ b/src/otopi/constants.py
@@ -63,7 +63,8 @@
     ENVIRONMENT_APPEND_PREFIX = 'APPEND:'
     CONFIG_SECTION_DEFAULT = 'environment:default'
     CONFIG_SECTION_INIT = 'environment:init'
-    CONFIG_SECTION_OVERRIDES = 'environment:override'
+    CONFIG_SECTION_OVERRIDE = 'environment:override'
+    CONFIG_SECTION_ENFORCE = 'environment:enforce'
     DIALOG_DIALECT_MACHINE = 'machine'
     DIALOG_DIALECT_HUMAN = 'human'
 
diff --git a/src/plugins/otopi/core/config.py b/src/plugins/otopi/core/config.py
index 972a6f0..532a262 100644
--- a/src/plugins/otopi/core/config.py
+++ b/src/plugins/otopi/core/config.py
@@ -134,6 +134,16 @@
     )
     def _customize(self):
         self._readEnvironment(
-            section=constants.Const.CONFIG_SECTION_OVERRIDES,
+            section=constants.Const.CONFIG_SECTION_OVERRIDE,
+            override=True,
+        )
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_CUSTOMIZATION,
+        priority=plugin.Stages.PRIORITY_LOW,
+    )
+    def _customize(self):
+        self._readEnvironment(
+            section=constants.Const.CONFIG_SECTION_ENFORCE,
             override=True,
         )


--
To view, visit http://gerrit.ovirt.org/10359
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50129b16d59a7ad8e1337fad9fc9b2cb650e8e0a
Gerrit-PatchSet: 1
Gerrit-Project: otopi
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to