[ 
https://issues.apache.org/jira/browse/LIBCLOUD-685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14393889#comment-14393889
 ] 

Samuel Marks commented on LIBCLOUD-685:
---------------------------------------

In the meantime, I've written a simple simple one-liner to see if it's online:

{code}
import socket

ping_port = lambda host, port: (lambda s: (lambda res: res or (lambda: 
(s.close(), True)[1])())(
    s.connect_ex((host, port))
))(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
ping_port.__doc__ = """ :returns True on success, [error] number > 0 otherwise 
"""
{code}

> Status not changing from pending on AWS EC2 southeast2 provider
> ---------------------------------------------------------------
>
>                 Key: LIBCLOUD-685
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-685
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Compute
>    Affects Versions: 0.15.0
>         Environment: Using libcloud 0.17.0 with Python 2.7.9 x64 on Windows 
> 8.1 x64.
>            Reporter: Samuel Marks
>              Labels: aws, aws-ec2, compute, ec2, ec2multiregionsnitch
>
> Both `node.extra['status']` and `node.state` report old information. I've 
> confirmed (through the web interface) that my AWS EC2 instance has started + 
> has status-checks up and running.
> However, even after 10 minutes the node status hasn't changed.
> How should I proceed?
> Thanks for all suggestions.
> PS: Here's a snippet from my wrapper:
> {code:none}
>     # `node` is instantiated by `.create_node` method of 
> `libcloud.compute.types.Provider` (actually: `libcloud.compute.drivers.ec2`, 
> probably: `BaseEC2NodeDriver.create_node`)
>     threshold = 60
>     print 'Waiting [up to] 10 minutes for node to come online'
>     PENDING = 3  # Where do I find the enum?!
>     while threshold and self.node.state == PENDING:
>         sleep(10)
>         threshold -= 1
>         print 'Waiting another:', threshold * 10, 'seconds. Status is:', 
> self.node.extra['status']
>     if self.node.state != PENDING:
>         print 'self.node.state =', self.node.state, 
> "self.node.extra['status'] =", self.node.extra['status']
>         return self.node
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to