Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Changelog
in development
--------------

Fixed
~~~~~

* Fix Type error for ``time_diff`` critera comparison. convert the timediff value as float to match
``timedelta.total_seconds()`` return.

Contributed by @blackstrip

Added
~~~~~

Expand Down
2 changes: 1 addition & 1 deletion st2common/st2common/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def _timediff(diff_target, period_seconds, operator):
# Note: date_utils.parse uses dateutil.parse which is way more flexible then strptime and
# supports many date formats
diff_target_utc = date_utils.parse(diff_target)
return operator((utc_now - diff_target_utc).total_seconds(), period_seconds)
return operator((utc_now - diff_target_utc).total_seconds(), float(period_seconds))


def timediff_lt(value, criteria_pattern):
Expand Down