Example #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(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: %(info)s'),
                 {'info': app_version})
        kwargs['app_version'] = app_version

        return NetAppDriver.create_driver(config.netapp_storage_family,
                                          config.netapp_storage_protocol,
                                          *args, **kwargs)
Example #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')
Example #3
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')