Skip to content
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

error handling in deploy-esxi broken with pyvmomi 6.0.0.2016.4 #44

Closed
glennmatthews opened this issue May 6, 2016 · 0 comments
Closed
Assignees
Labels

Comments

@glennmatthews
Copy link
Owner

In pyvmomi 6.0.0.2016.4, as a side effect of vmware/pyvmomi#341, connection failures now raise a socket.error instead of a requests.exceptions.ConnectionError, causing a test failure:

======================================================================
ERROR: test_serial_fixup_connection_error (COT.tests.test_deploy_esxi.TestCOTDeployESXi)
Call fixup_serial_ports() to connect to an invalid host.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "COT/tests/test_deploy_esxi.py", line 207, in test_serial_fixup_connection_error
    self.instance.fixup_serial_ports(2)
  File "COT/deploy_esxi.py", line 355, in fixup_serial_ports
    self.username, self.password) as conn:
  File "COT/deploy_esxi.py", line 70, in __enter__
    return super(SmarterConnection, self).__enter__()
  File ".tox/py27/lib/python2.7/site-packages/pyVim/connect.py", line 525, in __enter__
    self.si = SmartConnect(*self.args, **self.kwargs)
  File ".tox/py27/lib/python2.7/site-packages/pyVim/connect.py", line 786, in SmartConnect
    sslContext)
  File ".tox/py27/lib/python2.7/site-packages/pyVim/connect.py", line 671, in __FindSupportedVersion
    sslContext)
  File ".tox/py27/lib/python2.7/site-packages/pyVim/connect.py", line 591, in __GetServiceVersionDescription
    path + "/vimServiceVersions.xml", sslContext)
  File ".tox/py27/lib/python2.7/site-packages/pyVim/connect.py", line 557, in __GetElementTree
    conn.request("GET", path)
  File "/lib/python2.7/httplib.py", line 1057, in request
    self._send_request(method, url, body, headers)
  File "/lib/python2.7/httplib.py", line 1097, in _send_request
    self.endheaders(body)
  File "/lib/python2.7/httplib.py", line 1053, in endheaders
    self._send_output(message_body)
  File "/lib/python2.7/httplib.py", line 897, in _send_output
    self.send(msg)
  File "/lib/python2.7/httplib.py", line 859, in send
    self.connect()
  File "/lib/python2.7/httplib.py", line 1270, in connect
    HTTPConnection.connect(self)
  File "/lib/python2.7/httplib.py", line 836, in connect
    self.timeout, self.source_address)
  File "/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 61] Connection refused
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant