Add "datastore_service" property to sensor service so it has a
consistent api with the action service.
@@ -64,6 +64,10 @@ class SensorService(object):
self._client = None
+ @property
+ def datastore_service(self):
+ return self._datastore_service
+
def get_logger(self, name):
"""
Retrieve an instance of a logger to be used by the sensor class.
@@ -74,6 +78,17 @@ class SensorService(object):
return logger
+ ##################################
+ # General methods
+ ##################################
+
+ def get_user_info(self):
+ return self.datastore_service.get_user_info()
+
+ ##################################
+ # Sensor related methods
+ ##################################
+
def dispatch(self, trigger, payload=None, trace_tag=None):
"""
Method which dispatches the trigger.
@@ -124,13 +139,6 @@ class SensorService(object):
self._logger.debug('Dispatching trigger %s with payload %s.', trigger, payload)
self._dispatcher.dispatch(trigger, payload=payload, trace_context=trace_context)
- ##################################
- # General methods
- ##################################
-
- def get_user_info(self):
- return self.datastore_service.get_user_info()
-
##################################
# Methods for datastore management
##################################
