Ryan Barry has uploaded a new change for review. Change subject: Make VDSM plugin use the new ConfirmedEntry widget ......................................................................
Make VDSM plugin use the new ConfirmedEntry widget Entry fields which should be identical/confirmed use a different widget now to handle edge-case mismatches. Update the engine page to use this. Change-Id: I7c4be693342c22f60dc591993f4802672dde4ccc Signed-off-by: Ryan Barry <[email protected]> --- M src/engine_page.py 1 file changed, 3 insertions(+), 15 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-node-plugin-vdsm refs/changes/94/17494/1 diff --git a/src/engine_page.py b/src/engine_page.py index e1199ae..6d1ea6d 100644 --- a/src/engine_page.py +++ b/src/engine_page.py @@ -60,7 +60,6 @@ "vdsm_cfg.cert": "Verified" if utils.fs.Config().exists(cfg["cert_path"]) else "N/A", "vdsm_cfg.password": "", - "vdsm_cfg.password_confirmation": "" } return model @@ -86,9 +85,7 @@ "Engine UI"), ui.Label("vdsm_cfg.password._label2", "Note: Setting password will enable SSH daemon"), - ui.PasswordEntry("vdsm_cfg.password", "Password:"), - ui.PasswordEntry("vdsm_cfg.password_confirmation", - "Confirm Password:"), + ui.ConfirmedEntry("vdsm_cfg.password", "Password:", True), ] page = ui.Page("page", ws) @@ -98,18 +95,9 @@ return page def on_change(self, changes): - if changes.contains_any(["vdsm_cfg.password", - "vdsm_cfg.password_confirmation"]): + if changes.contains_any(["vdsm_cfg.password"]): self._model.update(changes) model = self._model - admin_pw = model.get("vdsm_cfg.password", "") - admin_pw_conf = model.get("vdsm_cfg.password_confirmation", "") - - if admin_pw != admin_pw_conf: - raise exceptions.InvalidData("Passwords must be the same.") - else: - self.widgets["vdsm_cfg.password"].valid(True) - self.widgets["vdsm_cfg.password_confirmation"].valid(True) pass @@ -161,7 +149,7 @@ txs = utils.Transaction("Configuring {engine_name}".format( engine_name=config.engine_name)) - if changes.contains_any(["vdsm_cfg.password_confirmation"]): + if changes.contains_any(["vdsm_cfg.password"]): self.logger.debug("Setting engine password") txs += [SetEnginePassword()] -- To view, visit http://gerrit.ovirt.org/17494 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c4be693342c22f60dc591993f4802672dde4ccc Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node-plugin-vdsm Gerrit-Branch: master Gerrit-Owner: Ryan Barry <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
