PyVmomi: Override __deepcopy__ method of SoapStuAdapter
Currently, we cannot deepcopy managed objects because managed objects have a threading lock (in the soap stub) which is an un(deep)copyable object. Hence, overriding the __deepcopy__ to fix this
This commit is contained in:
@@ -1393,6 +1393,12 @@ class SoapStubAdapter(SoapStubAdapterBase):
|
||||
pass
|
||||
conn.connect = ConnectDisableNagle
|
||||
|
||||
## Need to override the depcopy method. Since, the stub is not deep copyable
|
||||
# due to the thread lock and connection pool, deep copy of a managed object
|
||||
# fails. Further different instances of a managed object still share the
|
||||
# same soap stub. Hence, returning self here is fine.
|
||||
def __deepcopy__(self, memo):
|
||||
return self
|
||||
|
||||
HEADER_SECTION_END = '\r\n\r\n'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user