| 963 | |
| 964 | |
| 965 | def create_connection(host_port, use_kerberos=False, protocol=BEESWAX, |
| 966 | is_hive=False, use_ssl=False, collect_profile_and_log=True, user=None): |
| 967 | if protocol == BEESWAX: |
| 968 | c = BeeswaxConnection(host_port=host_port, use_kerberos=use_kerberos, |
| 969 | user=user, use_ssl=use_ssl) |
| 970 | elif protocol == HS2: |
| 971 | c = ImpylaHS2Connection(host_port=host_port, use_kerberos=use_kerberos, |
| 972 | is_hive=is_hive, use_ssl=use_ssl, |
| 973 | collect_profile_and_log=collect_profile_and_log, user=user) |
| 974 | else: |
| 975 | assert protocol == HS2_HTTP |
| 976 | c = ImpylaHS2Connection(host_port=host_port, use_kerberos=use_kerberos, |
| 977 | is_hive=is_hive, use_http_transport=True, http_path='cliservice', |
| 978 | use_ssl=use_ssl, collect_profile_and_log=collect_profile_and_log, |
| 979 | user=user) |
| 980 | |
| 981 | # A hook in conftest sets tests.common.current_node. Skip for Hive connections since |
| 982 | # Hive cannot modify client_identifier at runtime. |
| 983 | if hasattr(tests.common, "current_node") and not is_hive: |
| 984 | c.set_configuration_option("client_identifier", tests.common.current_node) |
| 985 | return c |
| 986 | |
| 987 | |
| 988 | def create_ldap_connection(host_port, user, password, use_ssl=False): |