Skip to content

No controls for timeouts. #2

@miguelortize

Description

@miguelortize

Great piece of code!

When trying to use the tool, I got a timeout error for WSO2 connection (using DNS, not /etc/hosts):

Could not connect to WSO2: ('Connection aborted.', DNSError(67, 'request timed out'))

I looked at the configuration files and everything was just fine (graphit-tool.py was working before!).

After reviewing the code and debugging the connection to IAM, I found that the first time it tried to connect, it failed with a timeout, the WSO2 logs did not show any attempt to connect (usually would get a 401 error), but if you send a second request to connect it would take it (200).

Quick ugly workaround:

        try:
               session.auth = WSO2AuthClientCredentials(
                       config.get('wso2', 'url'),
                       client = (
                               config.get('wso2', 'clientid'),
                               config.get('wso2', 'clientsecret')
                       ),
                       verify=wso2_verify)
       except:
               try:
                       session.auth = WSO2AuthClientCredentials(
                               config.get('wso2', 'url'),
                               client = (
                                       config.get('wso2', 'clientid'),
                                       config.get('wso2', 'clientsecret')
                               ),
                       verify=wso2_verify)
               except WSO2Error as e:
                       print >>sys.stderr, e
                       sys.exit(10)

Looping would get it to work.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions