Skip to content

Fix newly introduced python warnings in XenAPI.py #5761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions scripts/examples/python/XenAPI/XenAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,15 @@ def _login(self, method, params):
# pytype false positive: there is a socket.errno in both py2 and py3
if e.errno == socket.errno.ETIMEDOUT: # pytype: disable=module-attr
raise xmlrpclib.Fault(504, 'The connection timed out')
else:
raise e
raise e

def _logout(self):
try:
if self.last_login_method.startswith("slave_local"):
# Proxied function, pytype can't see it
return _parse_result(self.session.local_logout(self._session)) # pytype: disable=attribute-error
# pytype: disable=attribute-error
return _parse_result(self.session.local_logout(self._session))
# pytype: enable=attribute-error
else:
return _parse_result(self.session.logout(self._session))
finally:
Expand Down
Loading