Simone Tiraboschi has uploaded a new change for review.

Change subject: packaging: setup: removing local broker.conf
......................................................................

packaging: setup: removing local broker.conf

After https://gerrit.ovirt.org/#/c/42209/ the broker is also
able to get broker.conf from the storage domain.
Removing the local filesystem instance

Change-Id: If8794c5754010cd276cc7d69dd7ac9cc836d11a8
Signed-off-by: Simone Tiraboschi <stira...@redhat.com>
---
M src/ovirt_hosted_engine_setup/constants.py
M src/plugins/ovirt-hosted-engine-setup/core/conf.py
M src/plugins/ovirt-hosted-engine-setup/engine/os_install.py
M src/plugins/ovirt-hosted-engine-setup/ha/ha_notifications.py
4 files changed, 8 insertions(+), 29 deletions(-)


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

diff --git a/src/ovirt_hosted_engine_setup/constants.py 
b/src/ovirt_hosted_engine_setup/constants.py
index a741f37..89de250 100644
--- a/src/ovirt_hosted_engine_setup/constants.py
+++ b/src/ovirt_hosted_engine_setup/constants.py
@@ -286,7 +286,7 @@
         SYSCONFDIR,
         'ovirt-hosted-engine-ha'
     )
-    NOTIFY_CONF_FILE = os.path.join(
+    NOTIFY_CONF_FILE = os.path.join(  # Only for upgrades, remove after 3.6
         ENGINE_HA_CONFDIR,
         'broker.conf'
     )
diff --git a/src/plugins/ovirt-hosted-engine-setup/core/conf.py 
b/src/plugins/ovirt-hosted-engine-setup/core/conf.py
index 37ade71..a20dd4f 100644
--- a/src/plugins/ovirt-hosted-engine-setup/core/conf.py
+++ b/src/plugins/ovirt-hosted-engine-setup/core/conf.py
@@ -150,8 +150,6 @@
         self.environment[
             ohostedcons.StorageEnv.HECONF_CONTENT
         ] = content
-        #  TODO: deprecate the file system instance when the
-        #  agent will be ready
         with transaction.Transaction() as localtransaction:
             localtransaction.append(
                 filetransaction.FileTransaction(
diff --git a/src/plugins/ovirt-hosted-engine-setup/engine/os_install.py 
b/src/plugins/ovirt-hosted-engine-setup/engine/os_install.py
index 7c3420f..c3b4a73 100644
--- a/src/plugins/ovirt-hosted-engine-setup/engine/os_install.py
+++ b/src/plugins/ovirt-hosted-engine-setup/engine/os_install.py
@@ -75,8 +75,6 @@
         self.environment[
             ohostedcons.StorageEnv.VM_CONF_CONTENT
         ] = content
-        #  TODO: deprecate the file system instance when the
-        #  agent will be ready
         with transaction.Transaction() as localtransaction:
             localtransaction.append(
                 filetransaction.FileTransaction(
diff --git a/src/plugins/ovirt-hosted-engine-setup/ha/ha_notifications.py 
b/src/plugins/ovirt-hosted-engine-setup/ha/ha_notifications.py
index 47fb47d..694f7e7 100644
--- a/src/plugins/ovirt-hosted-engine-setup/ha/ha_notifications.py
+++ b/src/plugins/ovirt-hosted-engine-setup/ha/ha_notifications.py
@@ -83,8 +83,6 @@
         stage=plugin.Stages.STAGE_INIT,
     )
     def _init(self):
-        self._conffile = ohostedcons.FileLocations.NOTIFY_CONF_FILE
-        self._enabled = os.path.exists(self._conffile)
         self.environment.setdefault(
             ohostedcons.NotificationsEnv.SMTP_SERVER,
             None
@@ -104,7 +102,9 @@
 
     @plugin.event(
         stage=plugin.Stages.STAGE_CUSTOMIZATION,
-        condition=lambda self: self._enabled,
+        condition=lambda self: not self.environment[
+            ohostedcons.CoreEnv.IS_ADDITIONAL_HOST
+        ],
     )
     def _customization(self):
         default_smtp_config = {
@@ -120,13 +120,7 @@
                 ohostedcons.NotificationsEnv.DEFAULT_DEST_EMAIL),
         }
         self._cfg = configparser.SafeConfigParser()
-        self._cfg.read(self._conffile)
-        if self._cfg.has_section('email'):
-            for name, value in dict(self._cfg.items('email')).items():
-                if name in default_smtp_config:
-                    default_smtp_config[name] = value
-        else:
-            self._cfg.add_section('email')
+        self._cfg.add_section('email')
 
         interactions = (
             {
@@ -215,7 +209,9 @@
 
     @plugin.event(
         stage=plugin.Stages.STAGE_MISC,
-        condition=lambda self: self._enabled,
+        condition=lambda self: not self.environment[
+            ohostedcons.CoreEnv.IS_ADDITIONAL_HOST
+        ],
         name=ohostedcons.Stages.BROKER_CONF_AVAILABLE,
     )
     def _misc(self):
@@ -225,19 +221,6 @@
             self.environment[
                 ohostedcons.StorageEnv.BROKER_CONF_CONTENT
             ] = f.getvalue()
-            #  TODO: deprecate the file system instance when the
-            #  broker will be ready
-            self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append(
-                filetransaction.FileTransaction(
-                    name=self._conffile,
-                    content=self.environment[
-                        ohostedcons.StorageEnv.BROKER_CONF_CONTENT
-                    ],
-                    modifiedList=self.environment[
-                        otopicons.CoreEnv.MODIFIED_FILES
-                    ],
-                )
-            )
         finally:
             f.close()
 


-- 
To view, visit https://gerrit.ovirt.org/42233
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8794c5754010cd276cc7d69dd7ac9cc836d11a8
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Simone Tiraboschi <stira...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to