()
| 529 | |
| 530 | # Helper to initialize a sasl client |
| 531 | def sasl_factory(): |
| 532 | sasl_client = sasl.Client() |
| 533 | sasl_client.setAttr("host", sasl_host) |
| 534 | if self.use_ldap: |
| 535 | sasl_client.setAttr("username", self.user) |
| 536 | sasl_client.setAttr("password", self.ldap_password) |
| 537 | else: |
| 538 | sasl_client.setAttr("service", self.kerberos_service_name) |
| 539 | sasl_client.init() |
| 540 | return sasl_client |
| 541 | |
| 542 | transport = None |
| 543 | if not (self.use_ldap or self.use_kerberos): |