Skip to content
Snippets Groups Projects
Commit ca9839c7 authored by Taya Snijder's avatar Taya Snijder
Browse files

Merge branch 'master' into 2021-04-16-Branched_from_master-APSCTL_device

parents 0e64d1d8 d38353a7
No related branches found
No related tags found
1 merge request!27Resolve #2021 "04 16 branched from master apsctl device"
File moved
File moved
File moved
...@@ -22,32 +22,38 @@ def only_in_states(allowed_states): ...@@ -22,32 +22,38 @@ def only_in_states(allowed_states):
return wrapper return wrapper
def only_when_on(func): def only_when_on():
""" """
Wrapper to call and return the wrapped function if the device is Wrapper to call and return the wrapped function if the device is
in the ON state. Otherwise None is returned and nothing in the ON state. Otherwise None is returned and nothing
will be called. will be called.
""" """
@wraps(func) def inner(func):
def when_on_wrapper(self, *args, **kwargs): @wraps(func)
if self.get_state() == DevState.ON: def when_on_wrapper(self, *args, **kwargs):
return func(self, *args, **kwargs) if self.get_state() == DevState.ON:
return func(self, *args, **kwargs)
return None
return None return when_on_wrapper
return when_on_wrapper return inner
def fault_on_error(func): def fault_on_error():
""" """
Wrapper to catch exceptions. Sets the device in a FAULT state if any occurs. Wrapper to catch exceptions. Sets the device in a FAULT state if any occurs.
""" """
@wraps(func) def inner(func):
def error_wrapper(self, *args, **kwargs): @wraps(func)
try: def error_wrapper(self, *args, **kwargs):
return func(self, *args, **kwargs) try:
except Exception as e: return func(self, *args, **kwargs)
self.error_stream("Function failed. Trace: %s", traceback.format_exc()) except Exception as e:
self.Fault() self.error_stream("Function failed. Trace: %s", traceback.format_exc())
return None self.Fault()
return None
return error_wrapper
return error_wrapper return inner
This diff is collapsed.
version: '2' version: '2'
services: services:
maria-db: archiver-maria-db:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mariadb_hdbpp:latest image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mariadb_hdbpp:latest
container_name: archiver-maria-db container_name: archiver-maria-db
network_mode: ${NETWORK_MODE} network_mode: ${NETWORK_MODE}
...@@ -23,7 +23,7 @@ services: ...@@ -23,7 +23,7 @@ services:
depends_on: depends_on:
- databaseds - databaseds
- dsconfig - dsconfig
- maria-db - archiver-maria-db
environment: environment:
- TANGO_HOST=${TANGO_HOST} - TANGO_HOST=${TANGO_HOST}
- HdbManager=archiving/hdbpp/confmanager01 - HdbManager=archiving/hdbpp/confmanager01
...@@ -40,7 +40,7 @@ services: ...@@ -40,7 +40,7 @@ services:
depends_on: depends_on:
- databaseds - databaseds
- dsconfig - dsconfig
- maria-db - archiver-maria-db
environment: environment:
- TANGO_HOST=${TANGO_HOST} - TANGO_HOST=${TANGO_HOST}
- HdbManager=archiving/hdbpp/confmanager01 - HdbManager=archiving/hdbpp/confmanager01
......
...@@ -16,7 +16,7 @@ services: ...@@ -16,7 +16,7 @@ services:
depends_on: depends_on:
- databaseds - databaseds
- dsconfig - dsconfig
- maria-db - archiver-maria-db
- hdbpp-es - hdbpp-es
- hdbpp-cm - hdbpp-cm
volumes: volumes:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment