From 239dc9ff7fbedb82c02c58f658c92f8859011db5 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 2 Mar 2015 11:16:18 -0500 Subject: [PATCH] add string representation for context in the cases where context manages to make it's way into a log message we have no sane representation of it. The to_dict method provides the relevant information, so we can use a dump of that as our human friendly version. Change-Id: I394260c6957ba5c4f2b134e75cf8e7bd1d1b59c2 --- nova/context.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nova/context.py b/nova/context.py index af961f37c726..4610d4856514 100644 --- a/nova/context.py +++ b/nova/context.py @@ -188,6 +188,9 @@ class RequestContext(context.RequestContext): return context + def __str__(self): + return "" % self.to_dict() + def get_admin_context(read_deleted="no"): return RequestContext(user_id=None,