Comment 7 for bug 1385469

Revision history for this message
Xing Yang (xing-yang) wrote :

Here is a code snippet:

def _get_connection(self):

        try:
            conn = None
            conn = pywbem.WBEMConnection(self.url, (self.user, self.passwd),
                                         default_namespace='root/emc',
                                         x509=None,
                                         verify_callback=None,
                                         ca_certs=self.cert,
                                         no_verification=False)
        except TypeError:
            LOG.info(_LI("CA certificates not supported by the pywbem "
                         "library."))
            conn = pywbem.WBEMConnection(self.url, (self.user, self.passwd),
                                         default_namespace='root/emc')

        if conn is None:
            exception_message = (_("Cannot connect to ECOM server"))
            raise exception.VolumeBackendAPIException(data=exception_message)

        return conn