Add missing scope and decrypt, encrypt arguments to the get_value, set_value
and delete_value methods on the SensorWrapper class.
@@ -24,6 +24,7 @@ from oslo_config import cfg
from jsonschema import ValidationError
from st2common import log as logging
+from st2common.constants.keyvalue import SYSTEM_SCOPE
from st2common.logging.misc import set_log_level_for_all_loggers
from st2common.models.api.trace import TraceContext
from st2common.models.api.trigger import TriggerAPI
@@ -84,7 +85,7 @@ class SensorService(object):
##################################
def get_user_info(self):
- return self.datastore_service.get_user_info()
+ return self._datastore_service.get_user_info()
##################################
# Sensor related methods
@@ -145,16 +146,17 @@ class SensorService(object):
##################################
def list_values(self, local=True, prefix=None):
- return self._datastore_service.list_values(local, prefix)
+ return self.datastore_service.list_values(local, prefix)
- def get_value(self, name, local=True):
- return self._datastore_service.get_value(name, local)
+ def get_value(self, name, local=True, scope=SYSTEM_SCOPE, decrypt=False):
+ return self.datastore_service.get_value(name, local, scope=scope, decrypt=decrypt)
- def set_value(self, name, value, ttl=None, local=True):
- return self._datastore_service.set_value(name, value, ttl, local)
+ def set_value(self, name, value, ttl=None, local=True, scope=SYSTEM_SCOPE, encrypt=False):
+ return self.datastore_service.set_value(name, value, ttl, local, scope=scope,
+ encrypt=encrypt)
- def delete_value(self, name, local=True):
- return self._datastore_service.delete_value(name, local)
+ def delete_value(self, name, local=True, scope=SYSTEM_SCOPE):
+ return self.datastore_service.delete_value(name, local)
class SensorWrapper(object):
