Bug 966354 - Exception was shown when resetting admin password with the same value.
Summary: Exception was shown when resetting admin password with the same value.
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-node
Version: 3.3
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 3.3
Assignee: Ryan Barry
QA Contact:
URL:
Whiteboard: node
Depends On:
Blocks: ovirt-node-3.0
TreeView+ depends on / blocked
 
Reported: 2013-05-23 06:45 UTC by haiyang,dong
Modified: 2016-04-26 13:32 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-13 13:57:33 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)
attached Screenshot exception.png (12.40 KB, image/png)
2013-05-23 06:45 UTC, haiyang,dong
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 15079 0 None None None Never

Description haiyang,dong 2013-05-23 06:45:36 UTC
Created attachment 752004 [details]
attached Screenshot exception.png

Description of problem:
Install ovirt-node-upstream, enter into "Security" page and resetting admin password with the same value
in both "Password" and "Confirm Password" items. 
But Exception was shown after clicking "Save" button.(Seen exception.png)

Version-Release number of selected component (if applicable):
ovirt-node-iso-3.0.0-1.0.20130517.fc18.iso
       

Steps to Reproduce:
1. Install ovirt-node-upstream, configure network with "static".
2. enter Security page, then resetting admin password with the same value.


Actual results:
Exception was shown after clicking "Save" button.

Expected results:
Resetting admin password with the same value should be successful.

Additional info:
----------

Comment 1 Fabian Deutsch 2013-05-27 09:07:31 UTC
Hey,

I had two ideas related to this problem:
1. Introduce an InvalidChange exception which can be used during the on_change method, which gives the user control about what shall happen to the data. E.g. don't drop the invalid data, but keep it.
2. Use and fix NodePlugin.pending_changes(). Previously only invalid changes which were discoverred during the validation step were kept as invalid changes, now also invalid changes discovered during the on_change run are kept. That means they can be retrieved using NodePlugin.pending_changes(include_invalid=True).

The following patch uses the second (2) approach to solve this bug. As it uses existing infrastructure and does not include another way to solve this.
But we can discuss in general if (1) or (2) makes more sense.

http://gerrit.ovirt.org/#/c/15079/

Comment 2 Fabian Deutsch 2013-05-30 10:26:07 UTC
Ryan, Mike,

any comments or hints on what I might have missed?

Comment 3 Ryan Barry 2013-05-30 14:05:34 UTC
I don't think you missed anything, but I wanted to present an alternative. I've got a SameAs validator mostly working (up this afternoon) that should hide the ugly invalid change bits from the presentation layer and potentially from contributors who write plugins.

Comment 4 Ryan Barry 2013-06-07 21:58:00 UTC
Please review: 
http://gerrit.ovirt.org/#/c/15079/

I introduced a ValidatedEntry widget as a Container which creates children which must be valid. For ease in the presentation layer, the fact that it's instantiating multiple widgets is hidden from plugins. 

Unfortunately, the current implementation requires adding an attribute to an existing class, as well as tweaking the flow of validity in plugin pages to check whether or not every attribute is valid before lighting up the save button. A change of that magnitude isn't strictly necessary, as it's certainly possible to have the plugin check for some bogus change value as invalid even if it's not in the list of validators. I didn't want to go the route of magic numbers, and it seemed like triggering widget validity after it passes the validators was logical.

Feedback welcome.

Comment 5 Ryan Barry 2013-08-06 15:36:32 UTC
This change has been merged.


Note You need to log in before you can comment on or make changes to this bug.