Skip to content

Commit 17063f5

Browse files
Merge pull request GoogleCloudPlatform#4689 from ljqg/cos_mft_on_aarach64
minor bug fix on MFT version comparison
2 parents 514e942 + 8b3608d commit 17063f5

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

community/gce-cos-nvidia-bug-report/app/gce-cos-nvidia-bug-report.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -725,28 +725,30 @@ def IdentifyMftKernelModules(
725725
)
726726

727727
latest_blob = None
728-
latest_build_version = None
729-
latest_version = None
728+
latest_build_version_str = None
729+
latest_version_str = None
730+
latest_version_obj = None
730731
version_regex = re.compile(r"mft-kernel-modules-([\d\.]+)-(\d+)-.*\.tgz$")
731732
for blob in mft_kernel_module_blobs:
732733
match = version_regex.search(blob.name)
733734
if not match:
734735
continue
735736
current_version_str = match.group(1)
736737
build_version_str = match.group(2)
737-
current_version = version.parse(
738+
current_version_obj = version.parse(
738739
f"{current_version_str}.{build_version_str}"
739740
)
740-
if latest_version is None or current_version > latest_version:
741-
latest_version = current_version_str
742-
latest_build_version = build_version_str
741+
if latest_version_obj is None or current_version_obj > latest_version_obj:
742+
latest_version_str = current_version_str
743+
latest_version_obj = current_version_obj
744+
latest_build_version_str = build_version_str
743745
latest_blob = blob
744746
logging.info(
745747
"The latest MFT kernel modules available on COS tools is: %s-%s",
746-
latest_version,
747-
latest_build_version,
748+
latest_version_str,
749+
latest_build_version_str,
748750
)
749-
return latest_blob, latest_version, latest_build_version
751+
return latest_blob, latest_version_str, latest_build_version_str
750752

751753

752754
def DownloadMftKernelModulesFromCosTools(

0 commit comments

Comments
 (0)