Vojtech Szocs has submitted this change and it was merged.
Change subject: webadmin: StorageModel NPE (#822459)
......................................................................
webadmin: StorageModel NPE (#822459)
https://bugzilla.redhat.com/822459
Have a data center "Defaul (NFS, V1)" which can import NO storage, than:
1. open WebAdmin, switch to Storage main tab
2: click Import Domain - immediately a NPE mentioned above is thrown
3: switch Data Center to "(none)"
4: both "Domain Function / Storage Type" and "Use Host"
are correctly filled
5: let in "Domain Function / Storage Type" selected for example on
"Export/NFS"
6: switch the "Data Center" back to "Defaul (NFS, V1)"
7: the gui will show the same filled in "Domain Function / Storage Type"
as was for "(none)" ("Export/NFS" in this case).
There were more problems.
- StorageModel.DataCenter_SelectedItemChanged() called in row the
following methods:
- UpdateItemsAvailability
- UpdateFormat
- UpdateHost
Where the UpdateItemsAvailability after some returns from server calls
prepared the selectedItem on the model, and UpdateHost
(again after some server calls) used it. It was basically random if
the selected item will be prepared when the UpdateHost will need it.
Fixed by moving the call to UpdateFormat and UpdateHost to
StorageModelBehavior.OnStorageModelUpdated() to call them only after
the selectedItem will be prepared.
- The value NULL for selected storage domain is valid. To let the code
deal with it correctly, added some null checks, othervise it fails
on NPE.
- Added resetting of the selected host and selected item to prevent
the remembering of the old value when there is no new value to select.
Change-Id: I62b83fcd60c5db9078ed9fffa46dd0081c2f00eb
Signed-off-by: Tomas Jelinek <tjelinek(a)redhat.com>
---
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageModel.java
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageModelBehavior.java
M
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/storage/StoragePopupView.java
3 files changed, 40 insertions(+), 23 deletions(-)
Approvals:
Vojtech Szocs: Verified; Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/4545
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I62b83fcd60c5db9078ed9fffa46dd0081c2f00eb
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <tjelinek(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek(a)redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs(a)redhat.com>