Update affected code, make the same code change for process container.
@@ -33,11 +33,10 @@ from st2common.constants.triggers import (SENSOR_SPAWN_TRIGGER, SENSOR_EXIT_TRIG
from st2common.constants.exit_codes import SUCCESS_EXIT_CODE
from st2common.constants.exit_codes import FAILURE_EXIT_CODE
from st2common.models.system.common import ResourceReference
-from st2common.persistence.pack import Pack
from st2common.services.access import create_token
from st2common.transport.reactor import TriggerDispatcher
from st2common.util.api import get_full_public_api_url
-from st2common.util.pack import get_pack_common_libs_path
+from st2common.util.pack import get_pack_common_libs_path_for_pack_ref
from st2common.util.shell import on_parent_exit
from st2common.util.sandboxing import get_sandbox_python_path
from st2common.util.sandboxing import get_sandbox_python_binary_path
@@ -265,7 +264,6 @@ class ProcessSensorContainer(object):
"""
sensor_id = self._get_sensor_id(sensor=sensor)
pack_ref = sensor['pack']
- pack_db = Pack.get_by_ref(pack_ref)
virtualenv_path = get_sandbox_virtualenv_path(pack=pack_ref)
python_path = get_sandbox_python_binary_path(pack=pack_ref)
@@ -295,7 +293,11 @@ class ProcessSensorContainer(object):
sandbox_python_path = get_sandbox_python_path(inherit_from_parent=True,
inherit_parent_virtualenv=True)
- pack_common_libs_path = get_pack_common_libs_path(pack_db=pack_db)
+
+ if self._enable_common_pack_libs:
+ pack_common_libs_path = get_pack_common_libs_path_for_pack_ref(pack_ref=pack_ref)
+ else:
+ pack_common_libs_path = None
env = os.environ.copy()
