[jira] [Commented] (LIBCLOUD-971) wait_until_running error when empty ip addresses

2017-12-29 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LIBCLOUD-971:
-

Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/1156


> wait_until_running error when empty ip addresses
> 
>
> Key: LIBCLOUD-971
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-971
> Project: Libcloud
>  Issue Type: Bug
>  Components: Compute
>Affects Versions: 0.13.3
>Reporter: Tobias Paepke
>Priority: Minor
>
> wait_until_running leads to an libcloud error if no valid ip address was 
> provided by list_nodes. This happens in our setup especially if the node is 
> running, but has no valid ip address assigned via dhcp.
> The function should retry to get a valid ip address until the timeout is 
> reached.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (LIBCLOUD-971) wait_until_running error when empty ip addresses

2017-12-29 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on LIBCLOUD-971:
--

Commit 5c35c9894a776052c60fca4a0f0263bf6be7daad in libcloud's branch 
refs/heads/trunk from [~paepke]
[ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=5c35c98 ]

LIBCLOUD-971 - wait_until_running should only append addresses if the list is 
not empty.

Closes #1156

Part of LIBCLOUD-971.

Signed-off-by: Tomaz Muraus 


> wait_until_running error when empty ip addresses
> 
>
> Key: LIBCLOUD-971
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-971
> Project: Libcloud
>  Issue Type: Bug
>  Components: Compute
>Affects Versions: 0.13.3
>Reporter: Tobias Paepke
>Priority: Minor
>
> wait_until_running leads to an libcloud error if no valid ip address was 
> provided by list_nodes. This happens in our setup especially if the node is 
> running, but has no valid ip address assigned via dhcp.
> The function should retry to get a valid ip address until the timeout is 
> reached.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (LIBCLOUD-971) wait_until_running error when empty ip addresses

2017-12-29 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on LIBCLOUD-971:
--

Commit 5c35c9894a776052c60fca4a0f0263bf6be7daad in libcloud's branch 
refs/heads/trunk from [~paepke]
[ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=5c35c98 ]

LIBCLOUD-971 - wait_until_running should only append addresses if the list is 
not empty.

Closes #1156

Part of LIBCLOUD-971.

Signed-off-by: Tomaz Muraus 


> wait_until_running error when empty ip addresses
> 
>
> Key: LIBCLOUD-971
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-971
> Project: Libcloud
>  Issue Type: Bug
>  Components: Compute
>Affects Versions: 0.13.3
>Reporter: Tobias Paepke
>Priority: Minor
>
> wait_until_running leads to an libcloud error if no valid ip address was 
> provided by list_nodes. This happens in our setup especially if the node is 
> running, but has no valid ip address assigned via dhcp.
> The function should retry to get a valid ip address until the timeout is 
> reached.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[2/2] libcloud git commit: Add changelog entry for #1156.

2017-12-29 Thread tomaz
Add changelog entry for #1156.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/a03877af
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/a03877af
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/a03877af

Branch: refs/heads/trunk
Commit: a03877af970c9fc4fb340daa23a33772274ac898
Parents: 5c35c98
Author: Tomaz Muraus 
Authored: Fri Dec 29 14:38:05 2017 +0100
Committer: Tomaz Muraus 
Committed: Fri Dec 29 14:38:05 2017 +0100

--
 CHANGES.rst | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/a03877af/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index c3522b9..54569c8 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -109,6 +109,11 @@ Compute
 - [CloudStack] Handle NICs without addresses (GITHUB-1141)
   [Pierre-Yves Ritschard]
 
+- Fix "wait_until_running() method so it also works correctly and doesn't
+  append "None" to the addresses list if node has no IP address.
+  (GITHUB-1156, LIBCLOUD-971)
+  [Tobias Paepke]
+
 Storage
 ~~~
 



[1/2] libcloud git commit: LIBCLOUD-971 - wait_until_running should only append addresses if the list is not empty.

2017-12-29 Thread tomaz
Repository: libcloud
Updated Branches:
  refs/heads/trunk ac38dff52 -> a03877af9


LIBCLOUD-971 - wait_until_running should only append addresses if the list is 
not empty.

Closes #1156

Part of LIBCLOUD-971.

Signed-off-by: Tomaz Muraus 


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/5c35c989
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/5c35c989
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/5c35c989

Branch: refs/heads/trunk
Commit: 5c35c9894a776052c60fca4a0f0263bf6be7daad
Parents: ac38dff
Author: Tobias Paepke 
Authored: Wed Dec 20 14:04:19 2017 +0100
Committer: Tomaz Muraus 
Committed: Fri Dec 29 14:36:07 2017 +0100

--
 libcloud/compute/base.py|  7 +++-
 .../v1_slug_servers_detail_deployment_ipv6.xml  | 14 +++
 .../v1_slug_servers_detail_deployment_no_ip.xml | 14 +++
 libcloud/test/compute/test_deployment.py| 44 
 4 files changed, 77 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/5c35c989/libcloud/compute/base.py
--
diff --git a/libcloud/compute/base.py b/libcloud/compute/base.py
index 891a042..7d04509 100644
--- a/libcloud/compute/base.py
+++ b/libcloud/compute/base.py
@@ -1345,8 +1345,11 @@ class NodeDriver(BaseDriver):
 
 running_nodes = [node for node in matching_nodes
  if node.state == NodeState.RUNNING]
-addresses = [filter_addresses(getattr(node, ssh_interface))
- for node in running_nodes]
+addresses = []
+for node in running_nodes:
+node_addresses = filter_addresses(getattr(node, ssh_interface))
+if len(node_addresses) >= 1:
+addresses.append(node_addresses)
 
 if len(running_nodes) == len(uuids) == len(addresses):
 return list(zip(running_nodes, addresses))

http://git-wip-us.apache.org/repos/asf/libcloud/blob/5c35c989/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_ipv6.xml
--
diff --git 
a/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_ipv6.xml
 
b/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_ipv6.xml
new file mode 100644
index 000..e75b846
--- /dev/null
+++ 
b/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_ipv6.xml
@@ -0,0 +1,14 @@
+
+http://docs.rackspacecloud.com/servers/api/v1.0;>
+  
+
+
+  
+
+  
+  
+
+  
+
+  
+

http://git-wip-us.apache.org/repos/asf/libcloud/blob/5c35c989/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_no_ip.xml
--
diff --git 
a/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_no_ip.xml
 
b/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_no_ip.xml
new file mode 100644
index 000..e75b846
--- /dev/null
+++ 
b/libcloud/test/compute/fixtures/openstack/v1_slug_servers_detail_deployment_no_ip.xml
@@ -0,0 +1,14 @@
+
+http://docs.rackspacecloud.com/servers/api/v1.0;>
+  
+
+
+  
+
+  
+  
+
+  
+
+  
+

http://git-wip-us.apache.org/repos/asf/libcloud/blob/5c35c989/libcloud/test/compute/test_deployment.py
--
diff --git a/libcloud/test/compute/test_deployment.py 
b/libcloud/test/compute/test_deployment.py
index b2bdab2..83d76f3 100644
--- a/libcloud/test/compute/test_deployment.py
+++ b/libcloud/test/compute/test_deployment.py
@@ -224,6 +224,40 @@ class DeploymentTests(unittest.TestCase):
 self.assertEqual(self.node.uuid, node2.uuid)
 self.assertEqual(['67.23.21.33'], ips)
 
+def test_wait_until_running_without_ip(self):
+RackspaceMockHttp.type = 'NO_IP'
+
+try:
+node2, ips = self.driver.wait_until_running(
+nodes=[self.node], wait_period=1,
+timeout=0.5)[0]
+except LibcloudError:
+e = sys.exc_info()[1]
+self.assertTrue(e.value.find('Timed out after 0.5 second') != -1)
+else:
+self.fail('Exception was not thrown')
+
+def test_wait_until_running_with_only_ipv6(self):
+RackspaceMockHttp.type = 'IPV6'
+
+try:
+node2, ips = self.driver.wait_until_running(
+nodes=[self.node], wait_period=1,
+timeout=0.5)[0]
+except LibcloudError:
+e =