Skip to content

Commit e5524a3

Browse files
committed
fix(linstorvhdutil): call local method when possible in linstorhostcall context
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
1 parent 19cdbf0 commit e5524a3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/linstorvhdutil.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ def wrapper(*args, **kwargs):
101101
remote_args.update(**kwargs)
102102
remote_args = {str(key): str(value) for key, value in remote_args.items()}
103103

104+
this_host_ref = util.get_this_host_ref(self._session)
104105
def call_method(host_label, host_ref):
106+
if host_ref == this_host_ref:
107+
return self._call_local_method(local_method, device_path, *args[2:], **kwargs)
105108
response = call_remote_method(self._session, host_ref, remote_method, remote_args)
106109
log_successful_call(host_label, device_path, vdi_uuid, remote_method, response)
107110
return response_parser(self, vdi_uuid, response)

0 commit comments

Comments
 (0)