On Tuesday, July 31, 2012 6:32:07 AM UTC-7, Seba wrote:
When providing wrong credentials you should be getting this error:
pysphere.resources.vi_exception.VIApiException: [InvalidLoginFault]: Cannot complete login due to an incorrect user name or password.
InvalidLoginFault and the message after that are returned by the web service.
I haven't been able to get the error you sent. Can you provide more details on how to reproduce it? (a code snippet, your os and python version, etc)
This is using RHEL 5's stock Python 2.4. Here's a simple test case that shows the problem:
$ cat test_login.py
#!/usr/bin/python
import getpass
import os
import pysphere
host = "
host.example.com"
user = os.getlogin()
password = getpass.getpass()
server = pysphere.VIServer()
server.connect(host, user, password)
server.disconnect()
$ ./test_login.py
Password:
Traceback (most recent call last):
File "./test_login.py", line 11, in ?
server.connect(host, user, password)
File "/usr/lib/python2.4/site-packages/pysphere/vi_server.py", line 101, in connect
raise VIApiException(e)
File "/usr/lib/python2.4/site-packages/pysphere/resources/vi_exception.py", line 49, in __init__
super(self.__class__, self).__init__(message, fault)