From e6e6f414cd1374f3189960bf86201bf1e66fcb8a Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Fri, 15 Oct 2021 16:29:24 -0400 Subject: [PATCH] [mellanox] Remove validation for fw filenames with no extension (#8956) Why I did it Currently the mellanox platform API is validating the file extensions of firmware packages to be installed for basic sanity checking. However, ONIE packages do not have an extension and as such if there is a "." in the name it is taken to be an extension and then fails the sanity check. How I did it I removed the check which ensures that ONIE images don't have a file extension. How to verify it Name the ONIE updater file 2021.onie and attempt to install it via fwutil install fw 2021.onie --yes --- .../mellanox/mlnx-platform-api/sonic_platform/component.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/component.py b/platform/mellanox/mlnx-platform-api/sonic_platform/component.py index 3d339217b54f..4223e8517212 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/component.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/component.py @@ -405,10 +405,6 @@ def _check_file_validity(self, image_path): if name_list[1] != self.image_ext_name: print("ERROR: Extend name of file {} is wrong. Image for {} should have extend name {}".format(image_path, self.name, self.image_ext_name)) return False - else: - if name_list[1]: - print("ERROR: Extend name of file {} is wrong. Image for {} shouldn't have extension".format(image_path, self.name)) - return False return True