This repository was archived by the owner on Jul 1, 2021. It is now read-only.
Commit aeb98ec
vim.rb: enhance the logic of vim.rev. (#139)
* vim.rb: enhance the logic of vim.rev.
1. No matter if rev is specified when calls RbVmomi.connect, vim.rev
should be real version that effects current VIM connection.
Without this fix, say, vSphere is 6.5, and we give 7.0 to
RbVmomi.connect, then returned vim.rev will be 7.0. Even if we
give 100.0, obviously 100.0 is not a reasonable vSphere version,
returned vim.rev will be 100.0.
With this fix, returned vim.rev will be min value of vSphere
version and specified rev.
2. Enhanced version comparison.
Without this fix, version comparison is done by string comparison,
as a result "100.0" is smaller than "6.0". vSphere version has
reached to 8.x, once it reaches to "10.0", this bug will be
triggered.
With this fix, a version number is split into parts by ".", then
compare each part from left to right, so that "10.0" is bigger
than "6.0".
* Revert "vim.rb: enhance the logic of vim.rev."
This reverts commit 4efb0be.
* vim.rb: enhance the logic of vim.rev.
1. No matter if rev is specified when calls RbVmomi.connect, vim.rev
should be real version that effects current VIM connection.
Without this fix, say, vSphere is 6.5, and we give 7.0 to
RbVmomi.connect, then returned vim.rev will be 7.0. Even if we
give 100.0, obviously 100.0 is not a reasonable vSphere version,
returned vim.rev will be 100.0.
With this fix, returned vim.rev will be min value of vSphere
version and specified rev.
2. Enhanced version comparison.
Without this fix, version comparison is done by string comparison,
as a result "100.0" is smaller than "6.0". vSphere version has
reached to 8.x, once it reaches to "10.0", this bug will be
triggered.
With this fix, a version number is split into parts by ".", then
compare each part from left to right, so that "10.0" is bigger
than "6.0".1 parent 8df487b commit aeb98ec
1 file changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 63 | + | |
| 64 | + | |
68 | 65 | | |
69 | 66 | | |
70 | 67 | | |
| |||
0 commit comments