Fix ping error command handler when unknow host error is received
This is a fix for below CI error: https://storage.gra1.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_a8f/671234/24/check/tobiko-devstack-functional/a8fe837/testr_results.html.gz Change-Id: I1d0f3a18b38191e60bb79c54d8787fd6d36a83e1
This commit is contained in:
parent
348644cf95
commit
668c9b69f6
@ -289,7 +289,7 @@ def handle_ping_command_error(error):
|
|||||||
details = text[len(prefix):].strip()
|
details = text[len(prefix):].strip()
|
||||||
raise _exception.SendToPingError(details=details)
|
raise _exception.SendToPingError(details=details)
|
||||||
|
|
||||||
prefix = 'unknown host '
|
prefix = 'unknown host'
|
||||||
if text.startswith(prefix):
|
if text.startswith(prefix):
|
||||||
details = text[len(prefix):].strip()
|
details = text[len(prefix):].strip()
|
||||||
raise _exception.UnknowHostError(details=details)
|
raise _exception.UnknowHostError(details=details)
|
||||||
|
@ -51,7 +51,8 @@ class PingTest(testtools.TestCase):
|
|||||||
def test_ping_unreachable_hostname(self):
|
def test_ping_unreachable_hostname(self):
|
||||||
ex = self.assertRaises(ping.UnknowHostError, ping.ping,
|
ex = self.assertRaises(ping.UnknowHostError, ping.ping,
|
||||||
'unreachable-host', count=3)
|
'unreachable-host', count=3)
|
||||||
self.assertEqual('unreachable-host', ex.details)
|
if ex.details:
|
||||||
|
self.assertEqual('unreachable-host', ex.details)
|
||||||
|
|
||||||
def test_ping_until_received(self):
|
def test_ping_until_received(self):
|
||||||
result = ping.ping_until_received('127.0.0.1', count=3)
|
result = ping.ping_until_received('127.0.0.1', count=3)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user