def readable_pod_request(pod_req): try: return yaml.dump( pod_req, encoding="utf-8", allow_unicode=True, sort_keys=False, default_flow_style=False, ).decode("ascii", errors="ignore") except Exception as ex: logger.info("Failed to create readable pod request representation: %s", ex) return dumps_safe(pod_req)
def to_str(self, x): if self.sub_value_type: x = traverse(x, self.sub_value_type.to_str) return json_utils.dumps_safe(x)