diff --git a/docker-compose/device-boot.yml b/docker-compose/device-boot.yml index 58a9aa7df81eab368464f4ca69ddab54129b7ace..1d89047b7091ed3ee0a3ee04fb71df5ceb1ecb68 100644 --- a/docker-compose/device-boot.yml +++ b/docker-compose/device-boot.yml @@ -30,12 +30,8 @@ services: environment: - TANGO_HOST=${TANGO_HOST} entrypoint: - - /usr/local/bin/wait-for-it.sh - - ${TANGO_HOST} - - --timeout=30 - - --strict - - -- + - bin/start-ds.sh # configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA # can't know about our Docker port forwarding - - python3 -u /opt/lofar/tango/devices/devices/boot.py LTS -v -ORBendPoint giop:tcp:0:5708 -ORBendPointPublish giop:tcp:${HOSTNAME}:5708 + - l2ss-boot LTS -v -ORBendPoint giop:tcp:0:5708 -ORBendPointPublish giop:tcp:${HOSTNAME}:5708 restart: unless-stopped diff --git a/tangostationcontrol/setup.cfg b/tangostationcontrol/setup.cfg index 3fea7a30cdb6346e73953d179fe5f8fee437569b..529dde9840dd9ee044acd774d17f5aa2a4155ee9 100644 --- a/tangostationcontrol/setup.cfg +++ b/tangostationcontrol/setup.cfg @@ -34,6 +34,7 @@ where=./ [options.entry_points] console_scripts = + l2ss-boot = tangostationcontrol.devices.boot:main l2ss-docker-device = tangostationcontrol.devices.docker_device:main l2ss-observation = tangostationcontrol.devices.observation:main l2ss-observation-control = tangostationcontrol.devices.observation_control:main diff --git a/devices/devices/boot.py b/tangostationcontrol/tangostationcontrol/devices/boot.py similarity index 94% rename from devices/devices/boot.py rename to tangostationcontrol/tangostationcontrol/devices/boot.py index fb8a6947c6eb5775f96cb3660c5a123bba370ca9..6909e2babe4d5d6b0418d4bbebb750b42e4ddee1 100644 --- a/devices/devices/boot.py +++ b/tangostationcontrol/tangostationcontrol/devices/boot.py @@ -13,12 +13,6 @@ Boots the rest of the station software. """ -# TODO(Corne): Remove sys.path.append hack once packaging is in place! -import os, sys -currentdir = os.path.dirname(os.path.realpath(__file__)) -parentdir = os.path.dirname(currentdir) -sys.path.append(parentdir) - # PyTango imports from tango import DebugIt from tango.server import run, command @@ -29,10 +23,8 @@ import numpy from device_decorators import * -from clients.attribute_wrapper import attribute_wrapper -from devices.hardware_device import hardware_device -from common.lofar_logging import device_logging_to_python, log_exceptions -from common.lofar_git import get_version +from tangostationcontrol.devices.hardware_device import hardware_device +from tangostationcontrol.common.lofar_logging import device_logging_to_python, log_exceptions import logging logger = logging.getLogger() @@ -285,13 +277,9 @@ class Boot(hardware_device): # Run server # ---------- def main(args=None, **kwargs): - """Main function of the RECV module.""" + """Main function of the Boot module.""" - from common.lofar_logging import configure_logger + from tangostationcontrol.common.lofar_logging import configure_logger configure_logger() return run((Boot,), args=args, **kwargs) - - -if __name__ == '__main__': - main() diff --git a/tangostationcontrol/tangostationcontrol/devices/hardware_device.py b/tangostationcontrol/tangostationcontrol/devices/hardware_device.py index bb4625826ca416b87ae6a604825fbf822354da03..72832a06b24d75d5e92d193e102ae000e38ba42b 100644 --- a/tangostationcontrol/tangostationcontrol/devices/hardware_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/hardware_device.py @@ -15,7 +15,7 @@ from abc import abstractmethod # PyTango imports from tango.server import Device, command, DeviceMeta, attribute -from tango import DevState, DebugIt, Attribute, DeviceProxy +from tango import AttrWriteType, DevState, DebugIt, Attribute, DeviceProxy import time import math @@ -23,7 +23,7 @@ import math # Additional import from tangostationcontrol.clients.attribute_wrapper import attribute_wrapper from tangostationcontrol.common.lofar_logging import log_exceptions -from tangostationcontrol.common.lofar_git import get_version +from tangostationcontrol.common.lofar_version import get_version from tangostationcontrol.devices.abstract_device import AbstractDeviceMetas from tangostationcontrol.devices.device_decorators import only_in_states, fault_on_error diff --git a/tangostationcontrol/tangostationcontrol/test/clients/test_opcua_client.py b/tangostationcontrol/tangostationcontrol/test/clients/test_opcua_client.py index b1e73001328da7bd4681529c408b1514a143262b..52398dca633d9a96dfb7962bf68d4fc970d8eec9 100644 --- a/tangostationcontrol/tangostationcontrol/test/clients/test_opcua_client.py +++ b/tangostationcontrol/tangostationcontrol/test/clients/test_opcua_client.py @@ -1,12 +1,11 @@ import numpy import asyncua import io -import asyncio +import asynctest from unittest import mock -from test import base -import asynctest + from tangostationcontrol.clients.opcua_client import OPCUAConnection from tangostationcontrol.clients import opcua_client