[Mellanox] Fix issue: need import initialize_sdk_handle in get_sdk_handle (#6435)
Found test_sfp.py failed due to use a method without importing it.
This commit is contained in:
parent
68e9b83f3e
commit
0a49edb68e
@ -113,7 +113,6 @@ class Chassis(ChassisBase):
|
||||
|
||||
def initialize_sfp(self):
|
||||
from sonic_platform.sfp import SFP
|
||||
from sonic_platform.sfp import initialize_sdk_handle
|
||||
|
||||
self.sfp_module = SFP
|
||||
|
||||
@ -137,6 +136,7 @@ class Chassis(ChassisBase):
|
||||
|
||||
def get_sdk_handle(self):
|
||||
if not self.sdk_handle:
|
||||
from sonic_platform.sfp import initialize_sdk_handle
|
||||
self.sdk_handle = initialize_sdk_handle()
|
||||
if self.sdk_handle is None:
|
||||
logger.log_error('Failed to open SDK handle')
|
||||
|
Reference in New Issue
Block a user