Yedidyah Bar David has uploaded a new change for review.

Change subject: core: Allow automation of first interactions
......................................................................

core: Allow automation of first interactions

Move questions to stage setup, add to answer file.

Change-Id: Iffb05e4a520aa8f8f8a2d7f36e60aee556360302
Bug-Url: https://bugzilla.redhat.com/1101285
Signed-off-by: Yedidyah Bar David <[email protected]>
---
M src/ovirt_hosted_engine_setup/constants.py
M src/plugins/ovirt-hosted-engine-setup/core/misc.py
M src/plugins/ovirt-hosted-engine-setup/core/shell.py
3 files changed, 32 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup 
refs/changes/02/35302/1

diff --git a/src/ovirt_hosted_engine_setup/constants.py 
b/src/ovirt_hosted_engine_setup/constants.py
index 925659b..39dd203 100644
--- a/src/ovirt_hosted_engine_setup/constants.py
+++ b/src/ovirt_hosted_engine_setup/constants.py
@@ -292,6 +292,7 @@
 
 @util.export
 @util.codegen
+@ohostedattrsclass
 class CoreEnv(object):
     USER_ANSWER_FILE = 'OVEHOSTED_CORE/userAnswerFile'
     ETC_ANSWER_FILE = 'OVEHOSTED_CORE/etcAnswerFile'
@@ -299,9 +300,25 @@
     ADDITIONAL_HOST_ENABLED = 'OVEHOSTED_CORE/additionalHostEnabled'
     IS_ADDITIONAL_HOST = 'OVEHOSTED_CORE/isAdditionalHost'
     TEMPDIR = 'OVEHOSTED_CORE/tempDir'
-    DEPLOY_PROCEED = 'OVEHOSTED_CORE/deployProceed'
-    SCREEN_PROCEED = 'OVEHOSTED_CORE/screenProceed'
-    CONFIRM_SETTINGS = 'OVEHOSTED_CORE/confirmSettings'
+
+    @ohostedattrs(
+        answerfile=True,
+    )
+    def DEPLOY_PROCEED(self):
+        return 'OVEHOSTED_CORE/deployProceed'
+
+    @ohostedattrs(
+        answerfile=True,
+    )
+    def SCREEN_PROCEED(self):
+        return 'OVEHOSTED_CORE/screenProceed'
+
+    @ohostedattrs(
+        answerfile=True,
+    )
+    def CONFIRM_SETTINGS(self):
+        return 'OVEHOSTED_CORE/confirmSettings'
+
     RE_DEPLOY = 'OVEHOSTED_CORE/additionalHostReDeployment'
     NODE_SETUP = 'OVEHOSTED_CORE/nodeSetup'
 
diff --git a/src/plugins/ovirt-hosted-engine-setup/core/misc.py 
b/src/plugins/ovirt-hosted-engine-setup/core/misc.py
index 57d5821..81c25b9 100644
--- a/src/plugins/ovirt-hosted-engine-setup/core/misc.py
+++ b/src/plugins/ovirt-hosted-engine-setup/core/misc.py
@@ -57,19 +57,24 @@
             ohostedcons.FileLocations.OVIRT_HOSTED_ENGINE_SETUP
         )
         self.environment.setdefault(
-            ohostedcons.CoreEnv.DEPLOY_PROCEED,
-            None
-        )
-        self.environment.setdefault(
             otopicons.CoreEnv.LOG_DIR,
             ohostedcons.FileLocations.OVIRT_HOSTED_ENGINE_SETUP_LOGDIR
         )
 
     @plugin.event(
         stage=plugin.Stages.STAGE_INIT,
-        priority=plugin.Stages.PRIORITY_FIRST,
     )
     def _init(self):
+        self.environment.setdefault(
+            ohostedcons.CoreEnv.DEPLOY_PROCEED,
+            None
+        )
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_SETUP,
+        priority=plugin.Stages.PRIORITY_FIRST,
+    )
+    def _setup(self):
         interactive = self.environment[
             ohostedcons.CoreEnv.DEPLOY_PROCEED
         ] is None
diff --git a/src/plugins/ovirt-hosted-engine-setup/core/shell.py 
b/src/plugins/ovirt-hosted-engine-setup/core/shell.py
index 0bc9e16..cadc100 100644
--- a/src/plugins/ovirt-hosted-engine-setup/core/shell.py
+++ b/src/plugins/ovirt-hosted-engine-setup/core/shell.py
@@ -44,11 +44,11 @@
         super(Plugin, self).__init__(context=context)
 
     @plugin.event(
-        stage=plugin.Stages.STAGE_INIT,
+        stage=plugin.Stages.STAGE_SETUP,
         priority=plugin.Stages.PRIORITY_HIGH,
         condition=lambda self: not self.environment[otopicons.BaseEnv.ABORTED],
     )
-    def _init(self):
+    def _setup(self):
         self.environment.setdefault(
             ohostedcons.CoreEnv.SCREEN_PROCEED,
             None


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iffb05e4a520aa8f8f8a2d7f36e60aee556360302
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to