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