mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Fix collection datetime for isolated instance info
* 'last_isolated_check' was a non JSON-serializable object and needed to be a str
This commit is contained in:
@@ -153,6 +153,12 @@ def projects_by_scm_type(since):
|
|||||||
return counts
|
return counts
|
||||||
|
|
||||||
|
|
||||||
|
def _get_isolated_datetime(last_check):
|
||||||
|
if last_check:
|
||||||
|
return last_check.isoformat()
|
||||||
|
return last_check
|
||||||
|
|
||||||
|
|
||||||
@register('instance_info')
|
@register('instance_info')
|
||||||
def instance_info(since):
|
def instance_info(since):
|
||||||
info = {}
|
info = {}
|
||||||
@@ -166,7 +172,7 @@ def instance_info(since):
|
|||||||
'cpu': instance['cpu'],
|
'cpu': instance['cpu'],
|
||||||
'memory': instance['memory'],
|
'memory': instance['memory'],
|
||||||
'managed_by_policy': instance['managed_by_policy'],
|
'managed_by_policy': instance['managed_by_policy'],
|
||||||
'last_isolated_check': instance['last_isolated_check'],
|
'last_isolated_check': _get_isolated_datetime(instance['last_isolated_check']),
|
||||||
'enabled': instance['enabled']
|
'enabled': instance['enabled']
|
||||||
}
|
}
|
||||||
info[instance['uuid']] = instance_info
|
info[instance['uuid']] = instance_info
|
||||||
|
|||||||
Reference in New Issue
Block a user