(hosts, port)
| 178 | |
| 179 | |
| 180 | def _validate_port_spec(hosts, port): |
| 181 | if isinstance(port, list) and len(port) > 1: |
| 182 | # If there is a list of ports, its length must |
| 183 | # match that of the host list. |
| 184 | if len(port) != len(hosts): |
| 185 | raise exceptions.ClientConfigurationError( |
| 186 | 'could not match {} port numbers to {} hosts'.format( |
| 187 | len(port), len(hosts))) |
| 188 | elif isinstance(port, list) and len(port) == 1: |
| 189 | port = [port[0] for _ in range(len(hosts))] |
| 190 | else: |
| 191 | port = [port for _ in range(len(hosts))] |
| 192 | |
| 193 | return port |
| 194 | |
| 195 | |
| 196 | def _parse_hostlist(hostlist, port, *, unquote=False): |
no outgoing calls
no test coverage detected