Skip to content

Commit

Permalink
[Platform][nokia]: python3-smbus package add with python3 and jinja f…
Browse files Browse the repository at this point in the history
…ixes (#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 <keene@nokia.com>
  • Loading branch information
2 people authored and lguohan committed Jan 15, 2021
1 parent 9f89da1 commit d2f684b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 #}
{}

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# this file empty temporarily until qos supported SAI Marvell
{# this file empty temporarily until qos supported SAI Marvell #}
{}
1 change: 1 addition & 0 deletions dockers/docker-platform-monitor/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN apt-get update && \
librrd-dev \
rrdtool \
python-smbus \
python3-smbus \
ethtool \
dmidecode \
i2c-tools \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def __read_eeprom_specific_bytes(self, offset, num_bytes):
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
""" 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

Expand Down

0 comments on commit d2f684b

Please sign in to comment.