[node-patches] Change in ovirt-node[master]: cim: disable cim transaction run without a password

hadong0720 at gmail.com hadong0720 at gmail.com
Wed Nov 6 07:52:17 UTC 2013


hadong has uploaded a new change for review.

Change subject: cim: disable cim transaction run without a password
......................................................................

cim: disable cim transaction run without a password

Previously when users selected enable cim without a password
it will run cim transaction and enable cim service.
Now if the user selected enable cim without a password, it
will prompt ConfirmationDialog to show "Unable to configure CIM
without a password!" info.

Change-Id: I292ab6e9d00368e65b7e194e99cca8fc3b63ab72
Bug-Url:https://bugzilla.redhat.com/show_bug.cgi?id=1027110
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M src/ovirt/node/setup/cim/cim_page.py
1 file changed, 16 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/50/20950/1

diff --git a/src/ovirt/node/setup/cim/cim_page.py b/src/ovirt/node/setup/cim/cim_page.py
index e49eca2..e8ec97e 100644
--- a/src/ovirt/node/setup/cim/cim_page.py
+++ b/src/ovirt/node/setup/cim/cim_page.py
@@ -87,10 +87,20 @@
         if changes.contains_any(cim_keys):
             is_enabled = effective_model["cim.enabled"]
             pw = effective_model["cim.password"]
-
-            model = cim_model.CIM()
-            model.update(is_enabled)
-            txs += model.transaction(cim_password=pw)
-        progress_dialog = ui.TransactionProgressDialog("dialog.txs", txs, self)
-        progress_dialog.run()
+            if is_enabled and len(pw) == 0:
+                txt = "Unable to configure CIM without a password!"
+                self._confirm_dialog = ui.ConfirmationDialog("dialog.confirm",
+                                                             "CIM Error",
+                                                             txt,
+                                                             )
+                return self._confirm_dialog
+            else:
+                model = cim_model.CIM()
+                model.update(is_enabled)
+                txs += model.transaction(cim_password=pw)
+                progress_dialog = ui.TransactionProgressDialog("dialog.txs",
+                                                               txs, self)
+                progress_dialog.run()
+        if "dialog.confirm.yes" in changes:
+            self._confirm_dialog.close()
         return self.ui_content()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I292ab6e9d00368e65b7e194e99cca8fc3b63ab72
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list