Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
[platform][barefoot] Drop python2 support (sonic-net#7029)
Browse files Browse the repository at this point in the history
No longer install Python 2 sonic_platform package for Broadcom platforms; only install Python 3 package.

Signed-off-by: Volodymyr Boyko <[email protected]>
  • Loading branch information
vboykox authored Mar 12, 2021
1 parent 7caa70d commit 35dd885
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
set -e

PLATFORM_NAME=x86_64-accton_wedge100bf_32x-r0
SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl"
python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2}
SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl"
python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

python2 -m pip uninstall -y sonic-platform
python3 -m pip uninstall -y sonic-platform

#DEBHELPER#
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ WHEEL_BUILD_DIR := $(BUILD_DIR)/wheel

override_dh_auto_build:
set -e
python2.7 setup.py bdist_wheel -d $(WHEEL_BUILD_DIR)
python3 setup.py bdist_wheel -d $(WHEEL_BUILD_DIR)
set +e

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
_EEPROM_SYMLINK = "/var/run/platform/eeprom/syseeprom"
_EEPROM_STATUS = "/var/run/platform/eeprom/status"

try:
_str_type = basestring
except NameError:
_str_type = str

class Eeprom(eeprom_tlvinfo.TlvInfoDecoder):
def __init__(self):
with open(os.path.dirname(__file__) + "/logging.conf", 'r') as f:
Expand Down Expand Up @@ -89,7 +84,7 @@ def __eeprom_init(self, platform_eeprom):
if elem is None:
continue

if isinstance(val, _str_type):
if isinstance(val, str):
value = val.replace('\0', '')
else:
value = str(val)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ MODULE_NAMES := as9516 as9516bf
override_dh_auto_build:
make -C $(KERNEL_SRC)/build M=$(MODULE_SRC)
set -e
python2.7 setup.py bdist_wheel -d $(WHEEL_BUILD_DIR)
python3 setup.py bdist_wheel -d $(WHEEL_BUILD_DIR)
set +e

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ systemctl enable bfn-newport.service
systemctl start bfn-newport.service

PLATFORM_NAME=x86_64-accton_as9516_32d-r0
SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl"
python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2}
SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl"
python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

python2 -m pip uninstall -y sonic-platform
python3 -m pip uninstall -y sonic-platform

#DEBHELPER#
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ systemctl enable bfn-newport.service
systemctl start bfn-newport.service

PLATFORM_NAME=x86_64-accton_as9516bf_32d-r0
SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl"
python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2}
SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl"
python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

python2 -m pip uninstall -y sonic-platform
python3 -m pip uninstall -y sonic-platform

#DEBHELPER#
2 changes: 0 additions & 2 deletions platform/barefoot/sonic-platform-modules-bfn/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
set -e

PLATFORM_NAME=x86_64-accton_wedge100bf_65x-r0
SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl"
python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2}
SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl"
python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3}

Expand Down
1 change: 0 additions & 1 deletion platform/barefoot/sonic-platform-modules-bfn/debian/prerm
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

python2 -m pip uninstall -y sonic-platform
python3 -m pip uninstall -y sonic-platform

#DEBHELPER#
1 change: 0 additions & 1 deletion platform/barefoot/sonic-platform-modules-bfn/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ WHEEL_BUILD_DIR := $(BUILD_DIR)/wheel

override_dh_auto_build:
set -e
python2.7 setup.py bdist_wheel -d $(WHEEL_BUILD_DIR)
python3 setup.py bdist_wheel -d $(WHEEL_BUILD_DIR)
set +e

Expand Down

0 comments on commit 35dd885

Please sign in to comment.