aboutsummaryrefslogtreecommitdiffstats
path: root/functest/cli/commands
diff options
context:
space:
mode:
Diffstat (limited to 'functest/cli/commands')
-rw-r--r--functest/cli/commands/cli_os.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/functest/cli/commands/cli_os.py b/functest/cli/commands/cli_os.py
index e97ab080..71cd78c5 100644
--- a/functest/cli/commands/cli_os.py
+++ b/functest/cli/commands/cli_os.py
@@ -9,6 +9,7 @@
import os
+from urlparse import urlparse
import click
@@ -27,8 +28,8 @@ class OpenStack(object):
self.openstack_creds = CONST.__getattribute__('openstack_creds')
self.snapshot_file = CONST.__getattribute__('openstack_snapshot_file')
if self.os_auth_url:
- self.endpoint_ip = self.os_auth_url.rsplit("/")[2].rsplit(":")[0]
- self.endpoint_port = self.os_auth_url.rsplit("/")[2].rsplit(":")[1]
+ self.endpoint_ip = urlparse(self.os_auth_url).hostname
+ self.endpoint_port = urlparse(self.os_auth_url).port
def ping_endpoint(self):
if self.os_auth_url is None: