Ejemplo n.º 1
0
    def test_check_flags(self):
        configuration = type('Fake',
                             (object,),
                             {'flag1': 'value1', 'flag2': 'value2'})

        self.assertIsNone(na_utils.check_flags(['flag1', 'flag2'],
                                               configuration))
Ejemplo n.º 2
0
    def test_check_flags(self):
        configuration = type('Fake',
                             (object,),
                             {'flag1': 'value1', 'flag2': 'value2'})

        self.assertIsNone(na_utils.check_flags(['flag1', 'flag2'],
                                               configuration))
Ejemplo n.º 3
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)

        app_version = na_utils.OpenStackInfo().info()
        LOG.info('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.º 4
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)

        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)