It's not necessary to pass context as kwarg to oslo.log in most cases
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Undecided
|
Bhagyashri Shewale | ||
OpenStack Compute (nova) |
Fix Released
|
Low
|
Sivasathurappan Radhakrishnan |
Bug Description
Nova is using oslo.context's RequestContext which means the context object is in scope when doing logging using oslo.log:
http://
But there are a lot of places in nova where we do something like:
context = context.elevated()
This is confusing because it makes you wonder if (1) you should be passing context in logging method and (2) if it's OK to pass the elevated context in this case or if you should be passing the original context.
It turns out that in this case neither is necessary. The elevated context just has the admin flag set, the request / user / project IDs in the context are left unchanged, which is what we want for logging. And the context is already in scope because of:
http://
So we don't need to pass it as a kwarg.
This bug is meant to scrub through nova and remove any unnecessary passing of the context object to oslo.log methods.
Changed in nova: | |
assignee: | nobody → Rahul U Nair (rahulunair) |
Changed in nova: | |
status: | Triaged → In Progress |
Changed in nova: | |
assignee: | nobody → Nikhil P (nikhilgowda3210) |
Changed in nova: | |
status: | In Progress → Confirmed |
Changed in nova: | |
status: | Confirmed → In Progress |
Changed in nova: | |
assignee: | Nikhil P (nikhilgowda3210) → Sivasathurappan Radhakrishnan (siva-radhakrishnan) |
Changed in cinder: | |
assignee: | nobody → Bhagyashri Shewale (bhagyashri-shewale) |
sir, if u let us we going to continue with this bug...thank you...