self._config.vmware_max_objects_retrieval = self.MAX_OBJECTS
self._config.vmware_tmp_dir = self.TMP_DIR
self._config.vmware_ca_file = self.CA_FILE
+ self._config.vmware_insecure = False
self._db = mock.Mock()
self._driver = vmdk.VMwareEsxVmdkDriver(configuration=self._config,
db=self._db)
self._config.vmware_task_poll_interval,
wsdl_loc=self._config.safe_get('vmware_wsdl_location'),
pbm_wsdl_loc=None,
- cacert=self._config.vmware_ca_file)
+ cacert=self._config.vmware_ca_file,
+ insecure=self._config.vmware_insecure)
class ImageDiskTypeTest(test.TestCase):
'backup and restore.'),
cfg.StrOpt('vmware_ca_file',
default=None,
- help='CA bundle file to verify vCenter server certificate.')
+ help='CA bundle file to use in verifying the vCenter server '
+ 'certificate.'),
+ cfg.BoolOpt('vmware_insecure',
+ default=False,
+ help='If true, the vCenter server certificate is not '
+ 'verified. If false, then the default CA truststore is '
+ 'used for verification. This option is ignored if '
+ '"vmware_ca_file" is set.'),
]
CONF = cfg.CONF
wsdl_loc = self.configuration.safe_get('vmware_wsdl_location')
pbm_wsdl = self.pbm_wsdl if hasattr(self, 'pbm_wsdl') else None
ca_file = self.configuration.vmware_ca_file
+ insecure = self.configuration.vmware_insecure
self._session = api.VMwareAPISession(ip, username,
password, api_retry_count,
task_poll_interval,
wsdl_loc=wsdl_loc,
pbm_wsdl_loc=pbm_wsdl,
- cacert=ca_file)
+ cacert=ca_file,
+ insecure=insecure)
return self._session
def _get_vc_version(self):