Ceph flags: "set since before <date>" when older than Thor's flag history #15
No files matched your search
+4
-1
@@ -281,7 +281,10 @@ def test_a_known_condition_matches_a_flag_by_its_name():
|
|||||||
e.process([f], T0)
|
e.process([f], T0)
|
||||||
acts = e.process([f], T0 + 120)
|
acts = e.process([f], T0 + 120)
|
||||||
assert [(a.kind, a.payload.get('ticket_id')) for a in acts] == [('known_note', '693930698')]
|
assert [(a.kind, a.payload.get('ticket_id')) for a in acts] == [('known_note', '693930698')]
|
||||||
assert e.incidents['cluster:ceph_flag:noout'].summary.startswith('Ceph flag noout set since ')
|
assert e.incidents['cluster:ceph_flag:noout'].summary.startswith('Ceph flag noout set since 20')
|
||||||
|
f.facts['run_start_open'] = True
|
||||||
|
e.process([f], T0 + 240)
|
||||||
|
assert e.incidents['cluster:ceph_flag:noout'].summary.startswith('Ceph flag noout set since before 20')
|
||||||
|
|
||||||
|
|
||||||
def test_ticket_text_says_when_the_start_is_only_a_lower_bound():
|
def test_ticket_text_says_when_the_start_is_only_a_lower_bound():
|
||||||
|
|||||||
+3
-1
@@ -392,7 +392,9 @@ class CephCheck:
|
|||||||
# Stable text: a summary that changes every cycle would re-send the ticket every 30 min.
|
# Stable text: a summary that changes every cycle would re-send the ticket every 30 min.
|
||||||
from ..ticket_text import utc
|
from ..ticket_text import utc
|
||||||
since = utc(inc.facts.get('run_start', inc.first_seen))[:16] + ' UTC'
|
since = utc(inc.facts.get('run_start', inc.first_seen))[:16] + ' UTC'
|
||||||
return f'Ceph flag {inc.facts.get("flag")} set since {since}'
|
# Set since before Thor's 24 h of flag history: the date is only a lower bound.
|
||||||
|
word = 'before ' if inc.facts.get('run_start_open') else ''
|
||||||
|
return f'Ceph flag {inc.facts.get("flag")} set since {word}{since}'
|
||||||
return inc.summary
|
return inc.summary
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in new issue
Block a user