SteveMcGrath/pySecurityCenter

list indices must be integers, not str

Closed this issue · 3 comments

Steve,

I am working on a new Windows 7 PC with python 2.7 and installed the latest version of the pySC module, 3.3.1. I have version 0.8.1 of poster installed and setuptools 0.6c11 for python 2.7. I am getting this error:

sc = securitycenter.SecurityCenter(host,user,passwd)
Traceback (most recent call last):
File "", line 1, in
File "securitycenter.py", line 48, in init
self.login(user, passwd)
File "securitycenter.py", line 310, in login
self._token = data['response']['token']
TypeError: list indices must be integers, not str

I have tried deleting the .py files from C:\Python27\Lib\site-packages and reinstalling via python setup.py install. I am not sure how to fix this. thanks.

This is a lack of error reporting for invalid logins currently, and is on my list of todos.

Basically the easiest way to fix is to check the credentials you are giving whatever code your running.

That fixed it thanks!
On Sep 22, 2012 2:16 AM, "Steven McGrath" notifications@github.com wrote:

This is a lack of error reporting for invalid logins currently, and is on
my list of todos.

Basically the easiest way to fix is to check the credentials you are
giving whatever code your running.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-8785978.

I have updated the code to throw a APIError: Invalid Login Credentials instead of the ambiguous string error if it cannot login for whatever reason. I'll also add a host unreachable in the future.