Skip to content

Commit 614cda9

Browse files
fix(log_failed_call): remove default error value and set value for the call without an error
Signed-off-by: Mathieu Labourier <mathieu.labourier@vates.tech>
1 parent a2ec9f1 commit 614cda9

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

drivers/linstorvhdutil.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ def log_successful_call(target_host, device_path, vdi_uuid, remote_method, respo
8080
priority=util.LOG_DEBUG
8181
)
8282

83-
def log_failed_call(target_host, next_target, device_path, vdi_uuid, remote_method, e=None):
83+
def log_failed_call(target_host, next_target, device_path, vdi_uuid, remote_method, e):
8484
util.SMlog(
8585
'Failed to call method on {} for device {} ({}): {}. Trying accessing on {}... (cause: {})'.format(
8686
target_host,
8787
device_path,
8888
vdi_uuid,
8989
remote_method,
9090
next_target,
91-
e if e else "no error provided"
91+
e
9292
),
9393
priority=util.LOG_DEBUG
9494
)
@@ -140,7 +140,14 @@ def wrapper(*args, **kwargs):
140140
except Exception as remote_e:
141141
self._raise_openers_exception(device_path, remote_e)
142142
else:
143-
log_failed_call('primary', 'another node', device_path, vdi_uuid, remote_method)
143+
log_failed_call(
144+
'primary',
145+
'another node',
146+
device_path,
147+
vdi_uuid,
148+
remote_method,
149+
"no primary"
150+
)
144151

145152
try:
146153
host = self._get_readonly_host(vdi_uuid, device_path, nodes)

0 commit comments

Comments
 (0)