summaryrefslogtreecommitdiff
path: root/trove/tests/api/configurations.py
diff options
context:
space:
mode:
Diffstat (limited to 'trove/tests/api/configurations.py')
-rw-r--r--trove/tests/api/configurations.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/trove/tests/api/configurations.py b/trove/tests/api/configurations.py
index 0382fe47..40a5023e 100644
--- a/trove/tests/api/configurations.py
+++ b/trove/tests/api/configurations.py
@@ -16,6 +16,7 @@
from datetime import datetime
import json
+import netaddr
from time import sleep
import uuid
@@ -24,6 +25,7 @@ from proboscis.asserts import assert_equal
from proboscis.asserts import assert_not_equal
from proboscis.asserts import assert_raises
from proboscis.asserts import assert_true
+from proboscis.asserts import fail
from proboscis import before_class
from proboscis.decorators import time_out
from proboscis import SkipTest
@@ -84,7 +86,11 @@ def _execute_query(host, user_name, password, query):
def _get_address(instance_id):
result = instance_info.dbaas_admin.mgmt.instances.show(instance_id)
- return result.ip[0]
+ try:
+ return next(str(ip) for ip in result.ip
+ if netaddr.valid_ipv4(ip))
+ except StopIteration:
+ fail("No IPV4 ip found")
def _test_configuration_is_applied_to_instance(instance, configuration_id):