From f5ecf1ee1c7adce756d50b295d942b4c3cfa73ec Mon Sep 17 00:00:00 2001 From: Taylor Cai <103631396+cel-taylor@users.noreply.github.com> Date: Thu, 26 May 2022 00:06:50 +0800 Subject: [PATCH] [device/celestica]:Fix failed test case of Haliburton snmp (#10844) --- device/celestica/x86_64-cel_e1031-r0/sonic_platform/psu.py | 2 +- .../celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/psu.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/psu.py index 136010802233..0ea4aceeba7b 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/psu.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/psu.py @@ -234,7 +234,7 @@ def get_position_in_parent(self): Returns: integer: The 1-based relative physical position in parent device or -1 if cannot determine the position """ - return -1 + return self.index + 1 def is_replaceable(self): """ diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py index d224281a5935..ab702d02d095 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py @@ -324,6 +324,5 @@ def get_position_in_parent(self): Returns: A int value, 0 represent ASIC thermal, 1 represent CPU thermal info """ - if self.postion == "cpu": - return 1 - return 0 + + return self.index + 1