mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-18 04:38:09 +00:00
Fix rendering datetime and None in CLI (#1221)
This commit is contained in:
@ -8,6 +8,7 @@ Simple CLI builder on top of a defined API (used for OneFuzz)
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import inspect
|
||||
import json
|
||||
import logging
|
||||
@ -502,12 +503,14 @@ def normalize(result: Any) -> Any:
|
||||
return {normalize(k): normalize(v) for (k, v) in result.items()}
|
||||
if isinstance(result, Enum):
|
||||
return result.name
|
||||
if isinstance(result, UUID):
|
||||
if isinstance(result, (UUID, datetime.datetime)):
|
||||
return str(result)
|
||||
if isinstance(result, (int, float, str)):
|
||||
return result
|
||||
if result is None:
|
||||
return result
|
||||
|
||||
logging.debug(f"unable to normalize type f{type(result)}")
|
||||
logging.warning(f"unable to normalize type f{type(result)}")
|
||||
|
||||
return result
|
||||
|
||||
|
Reference in New Issue
Block a user