diff options
Diffstat (limited to 'conductor')
-rw-r--r-- | conductor/conductor/data/plugins/vim_controller/multicloud.py | 9 | ||||
-rw-r--r-- | conductor/conductor/tests/unit/data/plugins/inventory_provider/test_multicloud.py | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/conductor/conductor/data/plugins/vim_controller/multicloud.py b/conductor/conductor/data/plugins/vim_controller/multicloud.py index 3d904b4..5c2b5f7 100644 --- a/conductor/conductor/data/plugins/vim_controller/multicloud.py +++ b/conductor/conductor/data/plugins/vim_controller/multicloud.py @@ -45,6 +45,12 @@ MULTICLOUD_OPTS = [ cfg.StrOpt('server_url_version', default='v0', help='The version of Multicloud API.'), + cfg.StrOpt('certificate_authority_bundle_file', + default='certificate_authority_bundle.pem', + help='Certificate Authority Bundle file in pem format. ' + 'Must contain the appropriate trust chain for the ' + 'Certificate file.'), + cfg.BoolOpt('enable_https_mode', default = False, help='enable HTTPs mode for multicloud connection'), ] CONF.register_opts(MULTICLOUD_OPTS, group='multicloud') @@ -109,6 +115,9 @@ class MULTICLOUD(base.VimControllerBase): "read_timeout": self.timeout, } self.rest = rest.REST(**kwargs) + if(self.conf.multicloud.enable_https_mode): + self.rest.server_url = self.base[:4]+'s'+self.base[4:] + self.rest.session.verify =self.conf.multicloud.certificate_authority_bundle_file def check_vim_capacity(self, vim_request): LOG.debug("Invoking check_vim_capacity api") diff --git a/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_multicloud.py b/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_multicloud.py index 1f4013e..34319d2 100644 --- a/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_multicloud.py +++ b/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_multicloud.py @@ -35,6 +35,7 @@ class TestMultiCloud(unittest.TestCase): ] cfg.CONF.register_cli_opts(cli_opts) self.mc_ep = mc.MULTICLOUD() + self.mc_ep.conf.set_override('certificate_authority_bundle_file', '../AAF_RootCA.cer', 'multicloud') self.mc_ep.conf.set_override('debug', False) def tearDown(self): |