Skip to content

Commit

Permalink
#183: Fix KeyError when 'current' is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Cynerva authored and marcoceppi committed May 24, 2017
1 parent 7806170 commit f1a5bad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion amulet/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def check_status(status):
service = status.get(service_name, {})
for unit_name, unit in service.items():
if unit['agent-status']:
if unit['agent-status']['current'] != 'idle':
if unit['agent-status'].get('current') != 'idle':
return False
since = datetime.strptime(unit['agent-status']['since'][:20], '%d %b %Y %H:%M:%S')
if (datetime.now() - since).total_seconds() < IDLE_THRESHOLD:
Expand Down

0 comments on commit f1a5bad

Please sign in to comment.