Ravi Nori has uploaded a new change for review. Change subject: webadmin: Keep validation/event message if there is an iso update to ovirt node host ......................................................................
webadmin: Keep validation/event message if there is an iso update to ovirt node host The code for checking if there is an iso update to ovirt-node host got removed when reworking ovirt host deploy sequence. shouldAlertUpgrade() is still available in HostGeneralModel.java Change-Id: I1b58f3c5f2ce1a7e9f5c151c07c6c32a2cbb8fe1 Bug-Url: https://bugzilla.redhat.com/1117393 Signed-off-by: Ravi Nori <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java 2 files changed, 56 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/91/30691/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java index 24bde38..66f06e8 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java @@ -1034,6 +1034,10 @@ setNonOperationalReasonEntity((getEntity().getNonOperationalReason() == NonOperationalReason.NONE ? null : (NonOperationalReason) getEntity().getNonOperationalReason())); + setHasAnyAlert(); + } + + public void setHasAnyAlert() { setHasAnyAlert(getHasNICsAlert() || getHasUpgradeAlert() || getHasManualFenceAlert() || getHasNoPowerManagementAlert() || getHasReinstallAlertNonResponsive() || getHasReinstallAlertInstallFailed() || getHasReinstallAlertMaintenance()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java index 25fbc47..52c8d39 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java @@ -96,6 +96,8 @@ @SuppressWarnings("unused") public class HostListModel extends ListWithDetailsModel implements ISupportSystemTreeContext { + private HostGeneralModel generalModel; + private UICommand privateNewCommand; public UICommand getNewCommand() @@ -1810,7 +1812,7 @@ { super.initDetailModels(); - HostGeneralModel generalModel = new HostGeneralModel(); + generalModel = new HostGeneralModel(); generalModel.getRequestEditEvent().addListener(this); generalModel.getRequestGOToEventsTabEvent().addListener(this); @@ -1892,6 +1894,55 @@ { super.onSelectedItemChanged(); updateActionAvailability(); + + if (getSelectedItem() != null) { + updateAlerts(); + } + } + + private void updateAlerts() { + final VDS vds = (VDS) getSelectedItem(); + final UIConstants constants = ConstantsManager.getInstance().getConstants(); + if (vds.getVdsType() == VDSType.oVirtNode) { + AsyncDataProvider.getInstance().getoVirtISOsList(new AsyncQuery(this, + new INewAsyncCallback() { + @Override + public void onSuccess(Object target, Object returnValue) { + + ArrayList<RpmVersion> isos = (ArrayList<RpmVersion>) returnValue; + if (isos.size() > 0) { + String [] hostOsInfo = vds.getHostOs().split("-"); //$NON-NLS-1$ + for (int counter = 0; counter < hostOsInfo.length; counter++) { + hostOsInfo[counter] = hostOsInfo[counter].trim(); + } + generalModel.setHasUpgradeAlert( + generalModel.shouldAlertUpgrade( + isos, + hostOsInfo + ) + ); + boolean executionAllowed = vds.getStatus() != VDSStatus.Up + && vds.getStatus() != VDSStatus.Installing + && vds.getStatus() != VDSStatus.PreparingForMaintenance + && vds.getStatus() != VDSStatus.Reboot + && vds.getStatus() != VDSStatus.PendingApproval; + + if (!executionAllowed) { + getUpgradeCommand() + .getExecuteProhibitionReasons() + .add(constants + .switchToMaintenanceModeToEnableUpgradeReason()); + } + getUpgradeCommand().setIsExecutionAllowed(executionAllowed); + } + + generalModel.setHasAnyAlert(); + + } + }), + vds.getId()); + } + } @Override -- To view, visit http://gerrit.ovirt.org/30691 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1b58f3c5f2ce1a7e9f5c151c07c6c32a2cbb8fe1 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Ravi Nori <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
