From 380edf054dbcf4054de5db1b835c6d1d9db891da Mon Sep 17 00:00:00 2001 From: carl-nokia <63672637+carl-nokia@users.noreply.github.com> Date: Tue, 12 Jan 2021 18:05:06 -0500 Subject: [PATCH] [Platform][nokia]: python3-smbus package add with python3 and jinja fixes (#6416) fix platform driver breakage due to python3 upgrade and fix load minigraph errors with config load_minigraph -y **- How I did it** added python3-smbus to the pmon docker template since the previous was python2 specific fixed additional "ord" python2 specific code fixed the jinja templates used by qos reload - the template logic required data to be parsed **- How to verify it** run "show platform XXX" commands and verify output run "sudo config load_minigraph -y" and verify configuration run "show interfaces XXX" and verify output Co-authored-by: Carl Keene --- .../armhf-nokia_ixs7215_52x-r0/Nokia-7215/buffers.json.j2 | 2 ++ device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/qos.json.j2 | 3 ++- dockers/docker-platform-monitor/Dockerfile.j2 | 1 + .../sonic-platform-nokia/7215/sonic_platform/sfp.py | 2 +- .../sonic-platform-nokia/7215/sonic_platform/watchdog.py | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/buffers.json.j2 b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/buffers.json.j2 index 9495a66c0d..a38350a982 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/buffers.json.j2 +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/buffers.json.j2 @@ -6,3 +6,5 @@ {# Port configuration to cable length look-up table #} {# Each record describes mapping of DUT (DUT port) role and neighbor role to cable length #} {# Roles described in the minigraph #} +{} + diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/qos.json.j2 b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/qos.json.j2 index 529f1be8a5..c28e2e13e9 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/qos.json.j2 +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/qos.json.j2 @@ -1 +1,2 @@ -# this file empty temporarily until qos supported SAI Marvell +{# this file empty temporarily until qos supported SAI Marvell #} +{} diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index 5d4d91d2d6..fc46dc6a52 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -21,6 +21,7 @@ RUN apt-get update && \ librrd-dev \ rrdtool \ python-smbus \ + python3-smbus \ ethtool \ dmidecode \ i2c-tools diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py index 1bf3d4c03d..274db04ded 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py @@ -210,7 +210,7 @@ class Sfp(SfpBase): sysfsfile_eeprom.seek(offset) raw = sysfsfile_eeprom.read(num_bytes) for n in range(0, num_bytes): - eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) except Exception as e: pass finally: diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py index 75ec3ab177..5d75a223c5 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py @@ -15,7 +15,7 @@ from sonic_py_common import logger """ ioctl constants """ IO_READ = 0x80000000 IO_SIZE_INT = 0x00040000 -IO_TYPE_WATCHDOG = ord('W') << 8 +IO_TYPE_WATCHDOG = 'W' << 8 WDR_INT = IO_READ | IO_SIZE_INT | IO_TYPE_WATCHDOG