Ejemplo n.º 1
0
    def __new__(cls, *args, **kwargs):

        config = kwargs.get('configuration', None)
        if not config:
            raise exception.InvalidInput(
                reason=_('Required configuration not found.'))

        config.append_config_values(driver.share_opts)
        config.append_config_values(options.netapp_proxy_opts)
        na_utils.check_flags(NetAppDriver.REQUIRED_FLAGS, config)
        na_utils.check_netapp_lib()

        app_version = na_utils.OpenStackInfo().info()
        LOG.info(_LI('OpenStack OS Version Info: %s'), app_version)
        kwargs['app_version'] = app_version

        driver_mode = NetAppDriver._get_driver_mode(
            config.netapp_storage_family, config.driver_handles_share_servers)

        return NetAppDriver._create_driver(config.netapp_storage_family,
                                           driver_mode,
                                           *args, **kwargs)
Ejemplo n.º 2
0
    def test_check_netapp_lib(self):
        mock_try_import = self.mock_object(importutils, 'try_import')

        na_utils.check_netapp_lib()

        mock_try_import.assert_called_once_with('netapp_lib')