Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sensor wrapper to make list_values() method congruent with regular datastore method. #5913

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ in development

Added
~~~~~
* Add support for `limit` and `offset` parameters in sensor wrapper `list_items()`
method to make congruent with regular datastore method. #5913

* Move `git clone` to `user_home/.st2packs` #5845

* Error on `st2ctl status` when running in Kubernetes. #5851
Expand Down
6 changes: 4 additions & 2 deletions st2reactor/st2reactor/container/sensor_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ def dispatch_with_context(self, trigger, payload=None, trace_context=None):
# Methods for datastore management
##################################

def list_values(self, local=True, prefix=None):
return self.datastore_service.list_values(local=local, prefix=prefix)
def list_values(self, local=True, prefix=None, limit=None, offset=0):
return self.datastore_service.list_values(
local=local, prefix=prefix, limit=limit, offset=offset
)

def get_value(self, name, local=True, scope=SYSTEM_SCOPE, decrypt=False):
return self.datastore_service.get_value(
Expand Down