diff options
author | Radoslav Gerganov <rgerganov@vmware.com> | 2018-08-31 09:48:23 +0300 |
---|---|---|
committer | Radoslav Gerganov <rgerganov@vmware.com> | 2018-08-31 09:48:23 +0300 |
commit | a47f0d0c4f766219bf61d122205c05034a97399c (patch) | |
tree | 0ac93070106050e304d519557bc856eb4c246e4f /oslo_vmware/api.py | |
parent | 577dc74e442a1fd82b30d9edcc85bd5b3491f45a (diff) | |
download | oslo-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.py | 3 |
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 |