summaryrefslogtreecommitdiff
path: root/oslo_vmware/api.py
diff options
context:
space:
mode:
authorRadoslav Gerganov <rgerganov@vmware.com>2018-08-31 09:48:23 +0300
committerRadoslav Gerganov <rgerganov@vmware.com>2018-08-31 09:48:23 +0300
commita47f0d0c4f766219bf61d122205c05034a97399c (patch)
tree0ac93070106050e304d519557bc856eb4c246e4f /oslo_vmware/api.py
parent577dc74e442a1fd82b30d9edcc85bd5b3491f45a (diff)
downloadoslo-vmware-a47f0d0c4f766219bf61d122205c05034a97399c.tar.gz
Check if there is a context set before updating the store
There are cases when there is no request context set when calling an async task in vCenter. Don't update the local store in those cases. Change-Id: Ieef237bd5de0ad1c12afbf57426c29e3ca678dfc
Diffstat (limited to 'oslo_vmware/api.py')
-rw-r--r--oslo_vmware/api.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/oslo_vmware/api.py b/oslo_vmware/api.py
index a86ecef..76cbeba 100644
--- a/oslo_vmware/api.py
+++ b/oslo_vmware/api.py
@@ -407,7 +407,8 @@ class VMwareAPISession(object):
:param task: managed object reference of the task
:param ctx: request context for the corresponding task
"""
- ctx.update_store()
+ if ctx is not None:
+ ctx.update_store()
try:
# we poll tasks too often, so skip logging the opID as it generates
# too much noise in the logs