Updated common.parse_compute_hosts to allow host names that include - and _
This commit is contained in:
parent
d1407fc796
commit
1b1a3b64f3
@ -249,7 +249,7 @@ def parse_compute_hosts(compute_hosts):
|
|||||||
:return: A list of host names.
|
:return: A list of host names.
|
||||||
:rtype: list(str)
|
:rtype: list(str)
|
||||||
"""
|
"""
|
||||||
return filter(None, re.split('\W+', compute_hosts))
|
return filter(None, re.split('[^a-zA-Z0-9\-_]+', compute_hosts))
|
||||||
|
|
||||||
|
|
||||||
@contract
|
@contract
|
||||||
|
@ -156,6 +156,8 @@ class Common(TestCase):
|
|||||||
assert common.parse_compute_hosts('') == []
|
assert common.parse_compute_hosts('') == []
|
||||||
assert common.parse_compute_hosts('test1, test2') == \
|
assert common.parse_compute_hosts('test1, test2') == \
|
||||||
['test1', 'test2']
|
['test1', 'test2']
|
||||||
|
assert common.parse_compute_hosts('test-1, test_2') == \
|
||||||
|
['test-1', 'test_2']
|
||||||
assert common.parse_compute_hosts('t1,, t2 , t3') == \
|
assert common.parse_compute_hosts('t1,, t2 , t3') == \
|
||||||
['t1', 't2', 't3']
|
['t1', 't2', 't3']
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user