[node-patches] Change in ovirt-node[master]: engine: Only connect if requested

fabiand at fedoraproject.org fabiand at fedoraproject.org
Fri Feb 8 15:45:20 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: engine: Only connect if requested
......................................................................

engine: Only connect if requested

Previously the page tried to connect to the engine every time it was
saved, this patch makes it depending on the state of the checkbox.
Also the logging is reconfigured after running the transaction, because
some imported script is messing with the logger.

Change-Id: I16ca421fda20d66713b3ffed54aafe2ddb0b7162
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/setup/engine_page.py
1 file changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/62/11862/1

diff --git a/scripts/tui/src/ovirt/node/setup/engine_page.py b/scripts/tui/src/ovirt/node/setup/engine_page.py
index cf9a3ba..79474b0 100644
--- a/scripts/tui/src/ovirt/node/setup/engine_page.py
+++ b/scripts/tui/src/ovirt/node/setup/engine_page.py
@@ -18,10 +18,11 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 # MA  02110-1301, USA.  A copy of the GNU General Public License is
 # also available at http://www.gnu.org/copyleft/gpl.html.
-import sys
-from ovirt.node import plugins, valid, ui, utils
+from ovirt.node import plugins, valid, ui, utils, app
 from ovirt.node.config.defaults import NodeConfigFileSection
 from ovirt.node.plugins import Changeset
+from ovirt.node.utils import console
+import sys
 
 """
 Configure Engine
@@ -36,9 +37,10 @@
         return 100
 
     def model(self):
+        cfg = VDSM().retrieve()
         model = {
-            "vdsm_cfg.address": "",
-            "vdsm_cfg.port": "443",
+            "vdsm_cfg.address": cfg["server"] or "",
+            "vdsm_cfg.port": cfg["port"] or "443",
             "vdsm_cfg.connect_and_validate": True,
             "vdsm_cfg.password": "",
             "vdsm_cfg.password_confirmation": "",
@@ -105,11 +107,15 @@
             txs += [SetEnginePassword()]
 
         if effective_model.contains_any(["vdsm_cfg.connect_and_validate"]):
-            self.logger.debug("Connecting to engine")
-            txs += [ActivateVDSM(changes["vdsm_cfg.connect_and_validate"])]
+            if effective_model["vdsm_cfg.connect_and_validate"]:
+                self.logger.debug("Connecting to engine")
+                txs += [ActivateVDSM(changes["vdsm_cfg.connect_and_validate"])]
 
         progress_dialog = ui.TransactionProgressDialog("dialog.txs", txs, self)
         progress_dialog.run()
+
+        # VDSM messes with logging, and we just reset it
+        app.configure_logging()
 
         # Acts like a page reload
         return self.ui_content()
@@ -120,7 +126,6 @@
 # Functions and classes to support the UI
 #
 #
-
 class VDSM(NodeConfigFileSection):
     """Class to handle VDSM configuration in /etc/default/ovirt file
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16ca421fda20d66713b3ffed54aafe2ddb0b7162
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list