summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/console_utils.py
diff options
context:
space:
mode:
authorChangBo Guo(gcb) <eric.guo@easystack.cn>2014-12-23 16:56:20 +0800
committerChangBo Guo(gcb) <eric.guo@easystack.cn>2014-12-23 21:32:04 +0800
commit72b871e176c4ec493c555e8fd28a3ad49ea799dd (patch)
tree8033d6faaa85b831c1c8e90e7fac8a910e21edb7 /ironic/drivers/modules/console_utils.py
parent98d4bfd3ec214f941d2f99bc8b5279bd0a9545ee (diff)
downloadironic-72b871e176c4ec493c555e8fd28a3ad49ea799dd.tar.gz
Reuse methods from netutils
Replace usages of is_valid_ipv4, is_valid_ipv6 from Ironic, by usages of this methods from oslo.utils and remove these methods from Ironic code. Change-Id: I5f2b50718f2d6ae2258a14055ddd77fc40d8a344
Diffstat (limited to 'ironic/drivers/modules/console_utils.py')
-rw-r--r--ironic/drivers/modules/console_utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ironic/drivers/modules/console_utils.py b/ironic/drivers/modules/console_utils.py
index 92f729339..e19fe40c4 100644
--- a/ironic/drivers/modules/console_utils.py
+++ b/ironic/drivers/modules/console_utils.py
@@ -25,6 +25,7 @@ import tempfile
import time
from oslo.config import cfg
+from oslo.utils import netutils
from oslo_concurrency import processutils
from ironic.common import exception
@@ -152,7 +153,7 @@ def get_shellinabox_console_url(port):
"""
console_host = CONF.my_ip
- if utils.is_valid_ipv6(console_host):
+ if netutils.is_valid_ipv6(console_host):
console_host = '[%s]' % console_host
console_url = "http://%s:%s" % (console_host, port)
return console_url