| Index: client/common_lib/base_barrier.py
|
| diff --git a/client/common_lib/base_barrier.py b/client/common_lib/base_barrier.py
|
| index e1063a912b8ca106ab7c11217b0c55e9e202c306..e4de635fcf6c22ff9073b597833c24b367947681 100644
|
| --- a/client/common_lib/base_barrier.py
|
| +++ b/client/common_lib/base_barrier.py
|
| @@ -5,16 +5,6 @@ from autotest_lib.client.common_lib import error
|
| # default barrier port
|
| _DEFAULT_PORT = 11922
|
|
|
| -def get_host_from_id(hostid):
|
| - # Remove any trailing local identifier following a #.
|
| - # This allows multiple members per host which is particularly
|
| - # helpful in testing.
|
| - if not hostid.startswith('#'):
|
| - return hostid.split('#')[0]
|
| - else:
|
| - raise error.BarrierError(
|
| - "Invalid Host id: Host Address should be specified")
|
| -
|
|
|
| class BarrierAbortError(error.BarrierError):
|
| """Special BarrierError raised when an explicit abort is requested."""
|
| @@ -169,6 +159,17 @@ class barrier(object):
|
| self._waiting = {} # Maps from hostname -> (client, addr) tuples.
|
|
|
|
|
| + def _get_host_from_id(self, hostid):
|
| + # Remove any trailing local identifier following a #.
|
| + # This allows multiple members per host which is particularly
|
| + # helpful in testing.
|
| + if not hostid.startswith('#'):
|
| + return hostid.split('#')[0]
|
| + else:
|
| + raise error.BarrierError(
|
| + "Invalid Host id: Host Address should be specified")
|
| +
|
| +
|
| def _update_timeout(self, timeout):
|
| if timeout is not None and self._start_time is not None:
|
| self._timeout_secs = (time() - self._start_time) + timeout
|
| @@ -396,14 +397,14 @@ class barrier(object):
|
| remote.settimeout(30)
|
| if is_master:
|
| # Connect to all slaves.
|
| - host = get_host_from_id(self._members[self._seen])
|
| + host = self._get_host_from_id(self._members[self._seen])
|
| logging.info("calling slave: %s", host)
|
| connection = (remote, (host, self._port))
|
| remote.connect(connection[1])
|
| self._master_welcome(connection)
|
| else:
|
| # Just connect to the master.
|
| - host = get_host_from_id(self._masterid)
|
| + host = self._get_host_from_id(self._masterid)
|
| logging.info("calling master")
|
| connection = (remote, (host, self._port))
|
| remote.connect(connection[1])
|
|
|