[node-patches] Change in ovirt-node[master]: snmp: disable snmp transaction run without a password
hadong0720 at gmail.com
hadong0720 at gmail.com
Tue Nov 5 05:17:37 UTC 2013
hadong has uploaded a new change for review.
Change subject: snmp: disable snmp transaction run without a password
......................................................................
snmp: disable snmp transaction run without a password
Previously when users selected enable snmp without a password
it will run snmp transaction and enable snmp service.
Now if the user selected enable snmp without a password, it
will prompt ConfirmationDialog to show "Unable to configure SNMP
without a password!" info.
Change-Id: I8e471eaccfae1dd438bdafc380e341f4ebf6b6ff
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1026222
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M src/ovirt/node/setup/snmp/snmp_page.py
1 file changed, 16 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/92/20892/1
diff --git a/src/ovirt/node/setup/snmp/snmp_page.py b/src/ovirt/node/setup/snmp/snmp_page.py
index 9e40448..7ba89fa 100644
--- a/src/ovirt/node/setup/snmp/snmp_page.py
+++ b/src/ovirt/node/setup/snmp/snmp_page.py
@@ -108,11 +108,20 @@
if changes.contains_any(snmp_keys):
is_enabled = effective_model["snmp.enabled"]
pw = effective_model["snmp.password"]
-
- model = snmp_model.SNMP()
- model.update(is_enabled)
- txs += model.transaction(snmp_password=pw)
-
- progress_dialog = ui.TransactionProgressDialog("dialog.txs", txs, self)
- progress_dialog.run()
+ if is_enabled and len(pw) == 0:
+ txt = "Unable to configure SNMP without a password!"
+ self._confirm_dialog = ui.ConfirmationDialog("dialog.confirm",
+ "SNMP Error",
+ txt,
+ )
+ return self._confirm_dialog
+ else:
+ model = snmp_model.SNMP()
+ model.update(is_enabled)
+ txs += model.transaction(snmp_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/20892
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e471eaccfae1dd438bdafc380e341f4ebf6b6ff
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