Skip to content

Commit

Permalink
Merge pull request #211 from TetrationAnalytics/mtimm/fix_patch_version
Browse files Browse the repository at this point in the history
ImcVersion: Only set patch version to z if it is a spin version
  • Loading branch information
vvb authored Oct 28, 2021
2 parents 036e172 + 5954cd8 commit 19bb6b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions imcsdk/imccoremeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ def _set_versions(self, match_obj):

# for spin builds 4.0(1S52), the patch version will be None
# In this scenario assume the version to be highest patch z
if self.__patch is None:
if self.__spin is not None and self.__patch is None:
self.__patch = 'z'
elif self.__patch.isdigit() and self.__mr.isdigit():
elif self.__patch is not None and self.__mr is not None and self.__patch.isdigit() and self.__mr.isdigit():
log.debug("Interim version encountered: %s. MR version has been bumped up." % self.version)
self.__mr = str(int(self.__mr) + 1)
self.__patch = 'a'
elif self.__patch.isalpha() and self.__spin:
elif self.__patch is not None and self.__patch.isalpha() and self.__spin:
log.debug("Interim version encountered: %s. patch version has been bumped up." % self.version)
self.__patch = str(chr(ord(self.__patch)+1))
return True
Expand Down
4 changes: 1 addition & 3 deletions tests/unit_tests/common/test_imcversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ def test_gt_different_major_version():


def test_patch_versions():
# when we don't see a patch version we use z
# so 2.0(12) will be considerde as 2.0(12z)
version1 = ImcVersion("2.0(12b)")
version2 = ImcVersion("2.0(12)")
assert_equal((version1 > version2), False)
assert_equal((version1 > version2), True)

0 comments on commit 19bb6b6

Please sign in to comment.