Skip to content

Commit

Permalink
Use pip to install systemd-python and update path.
Browse files Browse the repository at this point in the history
  • Loading branch information
ganglyu committed Apr 24, 2022
1 parent 061ae8f commit 2e78e3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
# Mark runtime dependencies as manually installed to avoid them being auto-removed while uninstalling build dependencies
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-mark manual gir1.2-glib-2.0 libdbus-1-3 libgirepository-1.0-1 libsystemd0 python3-dbus

# Install systemd-python for SONiC host services
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install systemd-python

# Install SONiC host services package
SONIC_HOST_SERVICES_PY3_WHEEL_NAME=$(basename {{sonic_host_services_py3_wheel_path}})
sudo cp {{sonic_host_services_py3_wheel_path}} $FILESYSTEM_ROOT/$SONIC_HOST_SERVICES_PY3_WHEEL_NAME
Expand Down
10 changes: 5 additions & 5 deletions src/sonic-host-services/scripts/sonic-host-server
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ from gi.repository import GObject

def find_module_path():
"""Find path for host_moduels"""
for path in sys.path:
mod_path = path + '/host_modules'
if os.path.exists(mod_path):
return mod_path
return None
try:
from host_modules import host_service
return os.path.dirname(host_service.__file__)
except:
return None

def register_modules(mod_path):
"""Register all host modules"""
Expand Down

0 comments on commit 2e78e3c

Please sign in to comment.