Sandro Bonazzola has uploaded a new change for review.

Change subject: packaging: setup: avoid iso domain questions on update
......................................................................

packaging: setup: avoid iso domain questions on update

avoid iso domain questions on update from a previous
execution of engine-setup-2

Change-Id: I4e0805dc1b5d583445cdbd55c90ef1803febe4e6
Signed-off-by: Sandro Bonazzola <[email protected]>
---
M packaging/setup/ovirt_engine_setup/constants.py
M packaging/setup/plugins/ovirt-engine-setup/config/iso_domain.py
2 files changed, 32 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/58/15958/1

diff --git a/packaging/setup/ovirt_engine_setup/constants.py 
b/packaging/setup/ovirt_engine_setup/constants.py
index 8cbbd9b..054a766 100644
--- a/packaging/setup/ovirt_engine_setup/constants.py
+++ b/packaging/setup/ovirt_engine_setup/constants.py
@@ -668,6 +668,7 @@
         answerfile=True,
         summary=True,
         description=_('NFS setup'),
+        postinstallfile=True,
     )
     def NFS_CONFIG_ENABLED(self):
         return 'OVESETUP_SYSTEM/nfsConfigEnabled'
@@ -709,8 +710,23 @@
 
     MAC_RANGE_POOL = 'OVESETUP_CONFIG/macRangePool'
 
-    ISO_DOMAIN_SD_UUID = 'OVESETUP_CONFIG/isoDomainSdUuid'
-    ISO_DOMAIN_STORAGE_DIR = 'OVESETUP_CONFIG/isoDomainStorageDir'
+    @osetupattrs(
+        postinstallfile=True,
+    )
+    def ISO_DOMAIN_EXISTS(self):
+        return 'OVESETUP_CONFIG/isoDomainExists'
+
+    @osetupattrs(
+        postinstallfile=True,
+    )
+    def ISO_DOMAIN_SD_UUID(self):
+        return 'OVESETUP_CONFIG/isoDomainSdUuid'
+
+    @osetupattrs(
+        postinstallfile=True,
+    )
+    def ISO_DOMAIN_STORAGE_DIR(self):
+        return 'OVESETUP_CONFIG/isoDomainStorageDir'
 
     @osetupattrs(
         answerfile=True,
@@ -749,6 +765,7 @@
         answerfile=True,
         summary=True,
         description=_('NFS mount point'),
+        postinstallfile=True,
     )
     def ISO_DOMAIN_NFS_MOUNT_POINT(self):
         return 'OVESETUP_CONFIG/isoDomainMountPoint'
diff --git a/packaging/setup/plugins/ovirt-engine-setup/config/iso_domain.py 
b/packaging/setup/plugins/ovirt-engine-setup/config/iso_domain.py
index 66a299b..061f4f7 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/config/iso_domain.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/config/iso_domain.py
@@ -222,6 +222,10 @@
             osetupcons.ConfigEnv.ISO_DOMAIN_DEFAULT_NFS_MOUNT_POINT,
             osetupcons.FileLocations.ISO_DOMAIN_DEFAULT_NFS_MOUNT_POINT
         )
+        self.environment.setdefault(
+            osetupcons.ConfigEnv.ISO_DOMAIN_EXISTS,
+            False
+        )
 
         self.environment[
             osetupcons.ConfigEnv.ISO_DOMAIN_STORAGE_DIR
@@ -236,9 +240,10 @@
         after=[
             osetupcons.Stages.SYSTEM_NFS_CONFIG_AVAILABLE,
         ],
-        condition=lambda self: self.environment[
-            osetupcons.SystemEnv.NFS_CONFIG_ENABLED
-        ],
+        condition=lambda self: (
+            self.environment[osetupcons.SystemEnv.NFS_CONFIG_ENABLED] and
+            not self.environment[osetupcons.ConfigEnv.ISO_DOMAIN_EXISTS]
+        ),
     )
     def _customization(self):
         """
@@ -331,9 +336,10 @@
         after=[
             osetupcons.Stages.DB_CONNECTION_AVAILABLE,
         ],
-        condition=lambda self: self.environment[
-            osetupcons.SystemEnv.NFS_CONFIG_ENABLED
-        ],
+        condition=lambda self: (
+            self.environment[osetupcons.SystemEnv.NFS_CONFIG_ENABLED] and
+            not self.environment[osetupcons.ConfigEnv.ISO_DOMAIN_EXISTS]
+        ),
     )
     def _add_iso_domain_to_db(self):
         """
@@ -389,6 +395,7 @@
                 used=0,
             ),
         )
+        self.environment[osetupcons.ConfigEnv.ISO_DOMAIN_EXISTS] = True
 
 
 # vim: expandtab tabstop=4 shiftwidth=4


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

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

Reply via email to