6 Commits

Author SHA1 Message Date
Radoslav Gerganov
6a63362919 Add operation ID for remote calls
The operation ID is a random string which can be added in the SOAP
headers of the remote request. vCenter and ESX will append this opID to
every log message associated with the remote request. This allows
administrators to correlate log messages for particular operation across
different systems (OpenStack -> vCenter -> ESX).

There is also addition keyword argument 'skip_op_id' which allows
callers to disable logging the opID if set to True.

Example for correlating logs for CreateVM_Task on devstack, vCenter and
ESX: http://paste.openstack.org/show/592614/

Change-Id: I75cb71c7c58b4ee9cd36fc977eb2a18a911f161f
2016-12-20 17:46:49 +02:00
Javeme
b370ee5894 isoformat instead of deprecated timeutils.strtime
use isoformat() instead of deprecated oslo.timeutils.strtime()

ref:
https://github.com/openstack/oslo.utils/blob/master/oslo_utils/timeutils.py#L81

Change-Id: I3f0c7fe421add6880c2a000e2b052f0aeda1c4dc
2015-12-17 16:58:24 +08:00
Cedric Brandily
a5c6ed65d2 Define WithRetrieval context
WithRetrieval[1] is a context that handles and hides object retrieval
and retrieval cancel (when needed):

 with WithRetrieval(vim, retrieve_result) as objects:
   for obj in objects:
     do_something_including_breaking_for_loop(obj)

instead of:

 while retrieve_result:
   for obj in retrieve_result.objects:
      do_something_including_breaking_while_loop(obj)
   retrieve_result = continue_retrieval(vim, retrieve_result)
 if retrieve_result:
   cancel_retrieval(vim, retrieve_result)

[1] oslo_vmware.vim_util

Closes-Bug: #1284658
Change-Id: If29d45a25a81340e138eb9068a551fc1b172cf87
2015-09-29 11:38:24 +02:00
Davanum Srinivas
5de2c31e9d Switch to non-namespaced module imports
Looks like we missed a few

Change-Id: I803c09170c9dbc9439d71259f6b632c4cbb6037f
2015-03-12 11:38:50 -04:00
Sabari Kumar Murugesan
a95c0ae05f Add get_datastore_by_ref method to oslo.vmware
Two methods are added as part of this patch:-

1. get_datastore_by_ref - returns a Datastore object given a
datastore reference.

2. get_object_properties_dict - a vim utility method to retrieve
properties of an object as a dictionary.

Currently, Glance needs these methods to find datastore
objects from datastore references.

Change-Id: I516536ea4098357540531105b4f97e6668fb3f08
2015-02-26 12:18:58 -08:00
Doug Hellmann
48771e6bfd Move files out of the namespace package
Move the public API out of oslo.vmware to oslo_vmware. Retain the ability
to import from the old namespace package for backwards compatibility
for this release cycle.

bp/drop-namespace-packages

Change-Id: I11cf038c3832a7357ed53363d8ccf143daddd2a2
2015-01-12 13:22:13 -05:00