예제 #1
0
    def initialize(self):
        self.oneview_client = common.get_oneview_client()

        self.uplinkset_mappings = common.load_conf_option_to_dict(
            common.CONF.oneview.uplinkset_mappings)
        self.flat_net_mappings = common.load_conf_option_to_dict(
            common.CONF.oneview.flat_net_mappings)
        self.neutron_oneview_client = Client(
            self.oneview_client,
            self.uplinkset_mappings,
            self.flat_net_mappings
        )
        if common.CONF.oneview.tls_cacert_file.strip():
            self.oneview_client.connection.set_trusted_ssl_bundle(
                common.CONF.oneview.tls_cacert_file
            )
        if not common.CONF.oneview.developer_mode:
            sync = synchronization.Synchronization(
                self.oneview_client, self.neutron_oneview_client,
                common.CONF.database.connection,
                self.uplinkset_mappings, self.flat_net_mappings
            )
            sync.start()
            LOG.debug("OneView synchronization tool was initialized.")
        else:
            LOG.warning(
                "OneView synchronization tool will "
                "not be initialized due developer_mode.")
 def setUp(self):
     super(OneViewMechanismDriverTestCase, self).setUp()
     common.get_oneview_client = mock.MagicMock()
     oneview_client = common.get_oneview_client()
     oneview_client.logical_interconnect_groups.get.return_value = FAKE_LIG
     database_manager.get_neutron_oneview_network = mock.Mock(
         return_value=False)
     self.driver = mech_oneview.OneViewDriver()
     self.driver.oneview_client = oneview_client
     self.driver.neutron_oneview_client = neutron_oneview_client.Client(
         oneview_client, UPLINKSET_MAPPINGS, FLAT_NET_MAPPINGS)
     self.server_hardware = copy.deepcopy(FAKE_SERVER_HARDWARE)
     self.server_profile = copy.deepcopy(FAKE_SERVER_PROFILE)
예제 #3
0
    def __init__(self):
        self.oneview_client = common.get_oneview_client()
        self.uplinkset_mappings = common.load_conf_option_to_dict(
            CONF.DEFAULT.uplinkset_mappings)
        self.flat_net_mappings = common.load_conf_option_to_dict(
            CONF.DEFAULT.flat_net_mappings)

        common.check_valid_resources()
        common.check_uplinkset_types_constraint(
            self.oneview_client, self.uplinkset_mappings)
        common.check_unique_lig_per_provider_constraint(
            self.uplinkset_mappings)

        self.neutron_oneview_client = neutron_oneview_client.Client(
            self.oneview_client,
            self.uplinkset_mappings,
            self.flat_net_mappings
        )
예제 #4
0
 def test_get_oneview_client(self, mock_oneview_client):
     common.get_oneview_client()
     mock_oneview_client.assert_called_once_with(self.credentials)
예제 #5
0
 def test_get_oneview_client_insecure_cafile(self, mock_oneview_client):
     self.conf.oneview.allow_insecure_connections = True
     self.credentials["ssl_certificate"] = None
     common.get_oneview_client()
     mock_oneview_client.assert_called_once_with(self.credentials)