Douglas Schilling Landgraf has posted comments on this change. Change subject: frontend: node upgrade message improvement ......................................................................
Patch Set 3: (5 comments) .................................................... Commit Message Line 14: field it compares each segment delimited by dots and makes a comparison Line 15: between the node's OS and the ISO until it reaches a letter, Line 16: like "fc18" or "el6", which is derived from the rpm. Line 17: Line 18: oVirt Node - 2.6.0 - 20130212.0.fc18 20130212.0.fc18 typo, thanks for the catch. Line 19: oVirt Node - 2.6.0 - 20130212.fc18 Line 20: oVirt Node - 3.0.0 - 5.0.5.vdsm.fc19 Line 21: RHEV Hypervisor - 6.4 - 20130709.0.el6_4 Line 22: RHEV Hypervisor - 6.4 - 20130709.0.el6_4 Line 18: oVirt Node - 2.6.0 - 20130212.0.fc18 20130212.0.fc18 Line 19: oVirt Node - 2.6.0 - 20130212.fc18 Line 20: oVirt Node - 3.0.0 - 5.0.5.vdsm.fc19 Line 21: RHEV Hypervisor - 6.4 - 20130709.0.el6_4 Line 22: RHEV Hypervisor - 6.4 - 20130709.0.el6_4 ok Line 23: Line 24: Change-Id: I76bd2948524110ec80923e855bd1f49e09e17046 .................................................... File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java Line 681: alert = true; Line 682: break; Line 683: } Line 684: Line 685: if (Integer.toString(iso.getRevision()).length() > release_host[0].length()) { I have executed real tests on: ovirt-node-iso-2.6.0-20130212.fc18.noarch.rpm (ovirt-node-iso-2.6.0-20130212.fc18.iso) ovirt-node-iso-2.6.1-20120228.fc18.noarch.rpm (ovirt-node-iso-2.6.1-20120228.fc18.iso) rhev-hypervisor6-6.4-20130709.0.el6_4.noarch.rpm (rhevh-6.4-20130709.0.el6_4.iso) rhev-hypervisor6-6.5-20130725.0.el6.noarch.rpm (rhevh-6.5-20130725.0.el6.iso). We don't have official rpms for 3.3 versions, so I simulated as host reporting: oVirt Node - 3.0.0 - 5.0.5.vdsm.fc19 based on ovirt-node-iso-3.0.0-5.0.5.vdsm.fc19.iso > what do you expect from transforming it to a String, and try to split it to > parts > delimited by colon? Compare each segment/field/number, for example: 3.0.0-5.0.5 (First split by -), Results: 3.0.0 and 5.0.5 First three numbers (3.0.0): Is 3 == 3? (major) Is 0 > 0? (minor) Is 0 > 0? (build) Then, compare as many fields release (5.0.5) have splinting by dot 5 == 5 ? 0 == 5? 5 == 5? Line 686: alert = true; Line 687: break; Line 688: } Line 689: Line 681: alert = true; Line 682: break; Line 683: } Line 684: Line 685: if (Integer.toString(iso.getRevision()).length() > release_host[0].length()) { If we have a same release build twice or more in a day, like: rhev-hypervisor6-6.5-20130718.0 and rhev-hypervisor6-6.5-20130718.0 it will be catch. Line 686: alert = true; Line 687: break; Line 688: } Line 689: Line 686: alert = true; Line 687: break; Line 688: } Line 689: Line 690: String releaseISO [] = Integer.toString(iso.getRevision()).split("\\."); //$NON-NLS-1$ //$NON-NLS-2$ I have added the length validation above. Line 691: for (int i=0; i < release_host.length; i++) { Line 692: try { Line 693: if (Integer.parseInt(releaseISO[i].trim()) > Integer.parseInt(release_host[i].trim())) { Line 694: alert = true; -- To view, visit http://gerrit.ovirt.org/17987 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I76bd2948524110ec80923e855bd1f49e09e17046 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Douglas Schilling Landgraf <dougsl...@redhat.com> Gerrit-Reviewer: Barak Azulay <bazu...@gmail.com> Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Douglas Schilling Landgraf <dougsl...@redhat.com> Gerrit-Reviewer: Einav Cohen <eco...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches