Basic validation for some commandline options
()
| 230 | |
| 231 | |
| 232 | def _validate_options(): |
| 233 | """Basic validation for some commandline options""" |
| 234 | # the sasl module must be importable on a secure setup. |
| 235 | if options.use_kerberos: import sasl |
| 236 | |
| 237 | # If Hive is the exec engine, hs2 is the only suported interface. |
| 238 | if options.exec_engine.lower() == "hive" and options.client_type != "hs2": |
| 239 | raise RuntimeError("The only supported client type for Hive engine is hs2") |
| 240 | |
| 241 | # Check for duplicate workload/scale_factor combinations |
| 242 | workloads = split_and_strip(options.workloads) |
| 243 | if not len(set(workloads)) == len(workloads): |
| 244 | raise RuntimeError("Duplicate workload/scale factor combinations are not allowed") |
| 245 | |
| 246 | # The list of Impalads must be provided as a comma separated list of either host:port |
| 247 | # combination or just host. |
| 248 | for impalad in split_and_strip(options.impalads): |
| 249 | if len(impalad.split(":")) not in [1, 2]: |
| 250 | raise RuntimeError("Impalads must be of the form host:port or host.") |
| 251 | |
| 252 | |
| 253 | if __name__ == "__main__": |
no test coverage detected