Skip to content

Commit

Permalink
[docker-snmpd]: asyncsnmp depends on sonic-utilities so it is possibl…
Browse files Browse the repository at this point in the history
…e to import sonic_psu (#1212)

* asyncsnmp depends on sonic-utilities so it is possible to import sonic_psu

Signed-off-by: Qi Luo <[email protected]>

* Ignore sonic_utilities test during build
  • Loading branch information
qiluo-msft authored and lguohan committed Dec 7, 2017
1 parent c4f7cd3 commit 4b2225b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions dockers/docker-snmp-sv2/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ COPY [ \
"/debs/"]

# Install Python SwSSSDK (SNMP subagent dependency)
COPY python-wheels/sonic_utilities-*-py3-*.whl /python-wheels/
COPY python-wheels/swsssdk-*-py3-*.whl /python-wheels/
COPY python-wheels/asyncsnmp-*-py3-*.whl /python-wheels/

Expand Down
3 changes: 2 additions & 1 deletion rules/asyncsnmp-py3.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
ASYNCSNMP_PY3 = asyncsnmp-2.1.0-py3-none-any.whl
$(ASYNCSNMP_PY3)_SRC_PATH = $(SRC_PATH)/sonic-snmpagent
$(ASYNCSNMP_PY3)_PYTHON_VERSION = 3
$(ASYNCSNMP_PY3)_DEPENDS += $(SWSSSDK_PY3)
# Depends on sonic-utilities so it is possible to import sonic_psu
$(ASYNCSNMP_PY3)_DEPENDS += $(SWSSSDK_PY3) $(SONIC_UTILS_PY3)
SONIC_PYTHON_WHEELS += $(ASYNCSNMP_PY3)
8 changes: 8 additions & 0 deletions rules/sonic-utilities.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ SONIC_UTILS = python-sonic-utilities_1.1-1_all.deb
$(SONIC_UTILS)_SRC_PATH = $(SRC_PATH)/sonic-utilities
$(SONIC_UTILS)_WHEEL_DEPENDS = $(SONIC_CONFIG_ENGINE)
SONIC_PYTHON_STDEB_DEBS += $(SONIC_UTILS)

# Build sonic-utilities into python3 wheel, so we can use PSU code
# Note: _DEPENDS macro is not defined
SONIC_UTILS_PY3 = sonic_utilities-1.1-py3-none-any.whl
$(SONIC_UTILS_PY3)_SRC_PATH = $(SRC_PATH)/sonic-utilities
$(SONIC_UTILS_PY3)_PYTHON_VERSION = 3
$(SONIC_UTILS_PY3)_TEST = n
SONIC_PYTHON_WHEELS += $(SONIC_UTILS_PY3)
2 changes: 1 addition & 1 deletion slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) : $(PYTHON_WHEELS_PA
pushd $($*_SRC_PATH) $(LOG)
# apply series of patches if exist
if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; fi
python$($*_PYTHON_VERSION) setup.py test $(LOG)
[ "$($*_TEST)" = "n" ] || python$($*_PYTHON_VERSION) setup.py test $(LOG)
python$($*_PYTHON_VERSION) setup.py bdist_wheel $(LOG)
# clean up
if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then quilt pop -a -f; fi
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-utilities

0 comments on commit 4b2225b

Please sign in to comment.