Loading src/device/Config.py +6 −0 Original line number Diff line number Diff line Loading @@ -12,3 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. import os TRUE_VALUES = {'T', 'TRUE', 'YES', '1'} DEVICE_EMULATED_ONLY = os.environ.get('DEVICE_EMULATED_ONLY') LOAD_ALL_DEVICE_DRIVERS = (DEVICE_EMULATED_ONLY is None) or (DEVICE_EMULATED_ONLY.upper() not in TRUE_VALUES) src/device/service/DeviceService.py +1 −4 Original line number Diff line number Diff line Loading @@ -18,15 +18,12 @@ from common.Settings import get_service_port_grpc from common.proto.device_pb2_grpc import add_DeviceServiceServicer_to_server from common.proto.openconfig_device_pb2_grpc import add_OpenConfigServiceServicer_to_server from common.tools.service.GenericGrpcService import GenericGrpcService from device.Config import LOAD_ALL_DEVICE_DRIVERS from .driver_api.DriverInstanceCache import DriverInstanceCache from .DeviceServiceServicerImpl import DeviceServiceServicerImpl from .monitoring.MonitoringLoops import MonitoringLoops from .OpenConfigServicer import OpenConfigServicer TRUE_VALUES = {'T', 'TRUE', 'YES', '1'} DEVICE_EMULATED_ONLY = os.environ.get('DEVICE_EMULATED_ONLY') LOAD_ALL_DEVICE_DRIVERS = (DEVICE_EMULATED_ONLY is None) or (DEVICE_EMULATED_ONLY.upper() not in TRUE_VALUES) # Custom gRPC settings # Multiple clients might keep connections alive waiting for RPC methods to be executed. # Requests needs to be serialized to ensure correct device configurations Loading src/device/service/DeviceServiceServicerImpl.py +0 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ from context.client.ContextClient import ContextClient from .driver_api._Driver import _Driver from .driver_api.DriverInstanceCache import DriverInstanceCache, get_driver from .monitoring.MonitoringLoops import MonitoringLoops from .drivers.oc_driver.OCDriver import OCDriver from .ErrorMessages import ERROR_MISSING_DRIVER, ERROR_MISSING_KPI from .Tools import ( check_connect_rules, check_no_endpoints, compute_rules_to_add_delete, configure_rules, deconfigure_rules, Loading src/device/service/drivers/__init__.py +1 −4 Original line number Diff line number Diff line Loading @@ -15,12 +15,9 @@ import os from common.DeviceTypes import DeviceTypeEnum from common.proto.context_pb2 import DeviceDriverEnum from device.Config import LOAD_ALL_DEVICE_DRIVERS from ..driver_api.FilterFields import FilterFieldEnum TRUE_VALUES = {'T', 'TRUE', 'YES', '1'} DEVICE_EMULATED_ONLY = os.environ.get('DEVICE_EMULATED_ONLY') LOAD_ALL_DEVICE_DRIVERS = (DEVICE_EMULATED_ONLY is None) or (DEVICE_EMULATED_ONLY.upper() not in TRUE_VALUES) DRIVERS = [] from .emulated.EmulatedDriver import EmulatedDriver # pylint: disable=wrong-import-position Loading Loading
src/device/Config.py +6 −0 Original line number Diff line number Diff line Loading @@ -12,3 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. import os TRUE_VALUES = {'T', 'TRUE', 'YES', '1'} DEVICE_EMULATED_ONLY = os.environ.get('DEVICE_EMULATED_ONLY') LOAD_ALL_DEVICE_DRIVERS = (DEVICE_EMULATED_ONLY is None) or (DEVICE_EMULATED_ONLY.upper() not in TRUE_VALUES)
src/device/service/DeviceService.py +1 −4 Original line number Diff line number Diff line Loading @@ -18,15 +18,12 @@ from common.Settings import get_service_port_grpc from common.proto.device_pb2_grpc import add_DeviceServiceServicer_to_server from common.proto.openconfig_device_pb2_grpc import add_OpenConfigServiceServicer_to_server from common.tools.service.GenericGrpcService import GenericGrpcService from device.Config import LOAD_ALL_DEVICE_DRIVERS from .driver_api.DriverInstanceCache import DriverInstanceCache from .DeviceServiceServicerImpl import DeviceServiceServicerImpl from .monitoring.MonitoringLoops import MonitoringLoops from .OpenConfigServicer import OpenConfigServicer TRUE_VALUES = {'T', 'TRUE', 'YES', '1'} DEVICE_EMULATED_ONLY = os.environ.get('DEVICE_EMULATED_ONLY') LOAD_ALL_DEVICE_DRIVERS = (DEVICE_EMULATED_ONLY is None) or (DEVICE_EMULATED_ONLY.upper() not in TRUE_VALUES) # Custom gRPC settings # Multiple clients might keep connections alive waiting for RPC methods to be executed. # Requests needs to be serialized to ensure correct device configurations Loading
src/device/service/DeviceServiceServicerImpl.py +0 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ from context.client.ContextClient import ContextClient from .driver_api._Driver import _Driver from .driver_api.DriverInstanceCache import DriverInstanceCache, get_driver from .monitoring.MonitoringLoops import MonitoringLoops from .drivers.oc_driver.OCDriver import OCDriver from .ErrorMessages import ERROR_MISSING_DRIVER, ERROR_MISSING_KPI from .Tools import ( check_connect_rules, check_no_endpoints, compute_rules_to_add_delete, configure_rules, deconfigure_rules, Loading
src/device/service/drivers/__init__.py +1 −4 Original line number Diff line number Diff line Loading @@ -15,12 +15,9 @@ import os from common.DeviceTypes import DeviceTypeEnum from common.proto.context_pb2 import DeviceDriverEnum from device.Config import LOAD_ALL_DEVICE_DRIVERS from ..driver_api.FilterFields import FilterFieldEnum TRUE_VALUES = {'T', 'TRUE', 'YES', '1'} DEVICE_EMULATED_ONLY = os.environ.get('DEVICE_EMULATED_ONLY') LOAD_ALL_DEVICE_DRIVERS = (DEVICE_EMULATED_ONLY is None) or (DEVICE_EMULATED_ONLY.upper() not in TRUE_VALUES) DRIVERS = [] from .emulated.EmulatedDriver import EmulatedDriver # pylint: disable=wrong-import-position Loading