Merge "fixed http ping vnf support ipv6"
This commit is contained in:
commit
13ab911c9f
@ -12,6 +12,8 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import netaddr
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import six.moves.urllib.error as urlerr
|
import six.moves.urllib.error as urlerr
|
||||||
@ -64,6 +66,9 @@ class VNFMonitorHTTPPing(abstract_driver.VNFMonitorAbstractDriver):
|
|||||||
:return: bool - True or False depending on pingability.
|
:return: bool - True or False depending on pingability.
|
||||||
"""
|
"""
|
||||||
url = 'http://' + mgmt_ip + ':' + str(port)
|
url = 'http://' + mgmt_ip + ':' + str(port)
|
||||||
|
if netaddr.valid_ipv6(mgmt_ip):
|
||||||
|
url = 'http://[' + mgmt_ip + ']:' + str(port)
|
||||||
|
|
||||||
for retry_index in range(int(retry)):
|
for retry_index in range(int(retry)):
|
||||||
try:
|
try:
|
||||||
urlreq.urlopen(url, timeout=timeout)
|
urlreq.urlopen(url, timeout=timeout)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user