Пример #1
0
    def validate_raid_config(self, task, raid_config):
        """Validates the given RAID configuration.

        This method validates the given RAID configuration.  Driver
        implementations of this interface can override this method to support
        custom parameters for RAID configuration.

        :param task: a TaskManager instance.
        :param raid_config: The RAID configuration to validate.
        :raises: InvalidParameterValue, if the RAID configuration is invalid.
        """
        raid.validate_configuration(raid_config, self.raid_schema)
Пример #2
0
    def validate_raid_config(self, task, raid_config):
        """Validates the given RAID configuration.

        This method validates the given RAID configuration.  Driver
        implementations of this interface can override this method to support
        custom parameters for RAID configuration.

        :param task: a TaskManager instance.
        :param raid_config: The RAID configuration to validate.
        :raises: InvalidParameterValue, if the RAID configuration is invalid.
        """
        raid.validate_configuration(raid_config, self.raid_schema)
Пример #3
0
    def validate(self, task):
        """Validate a given RAID configuration.

        This method validates the properties defined by Ironic for RAID
        configuration. Driver implementations of this interface can override
        this method for doing more validations.

        :param task: a TaskManager instance.
        :raises: InvalidParameterValue, if the RAID configuration is invalid.
        """
        target_raid_config = task.node.target_raid_config
        if not target_raid_config:
            return

        raid.validate_configuration(target_raid_config, self.raid_schema)
Пример #4
0
    def validate(self, task):
        """Validate a given RAID configuration.

        This method validates the properties defined by Ironic for RAID
        configuration. Driver implementations of this interface can override
        this method for doing more validations.

        :param task: a TaskManager instance.
        :raises: InvalidParameterValue, if the RAID configuration is invalid.
        """
        target_raid_config = task.node.target_raid_config
        if not target_raid_config:
            return

        raid.validate_configuration(target_raid_config, self.raid_schema)
Пример #5
0
 def test_validate_configuration_max_size_gb(self):
     raid_config = json.loads(raid_constants.RAID_CONFIG_MAX_SIZE_GB)
     raid.validate_configuration(raid_config, raid_config_schema=self.schema)
Пример #6
0
 def test_validate_configuration_okay(self):
     raid_config = json.loads(raid_constants.RAID_CONFIG_OKAY)
     raid.validate_configuration(raid_config, raid_config_schema=self.schema)
Пример #7
0
 def test_validate_configuration_custom_schema(self):
     raid_config = json.loads(raid_constants.CUSTOM_SCHEMA_RAID_CONFIG)
     schema = json.loads(raid_constants.CUSTOM_RAID_SCHEMA)
     raid.validate_configuration(raid_config, raid_config_schema=schema)
Пример #8
0
 def test_validate_configuration_max_size_gb(self):
     raid_config = json.loads(raid_constants.RAID_CONFIG_MAX_SIZE_GB)
     raid.validate_configuration(raid_config,
                                 raid_config_schema=self.schema)
Пример #9
0
 def test_validate_configuration_okay_software(self):
     raid_config = json.loads(raid_constants.RAID_SW_CONFIG_OKAY)
     raid.validate_configuration(raid_config,
                                 raid_config_schema=self.schema)
Пример #10
0
 def test_validate_configuration_custom_schema(self):
     raid_config = json.loads(raid_constants.CUSTOM_SCHEMA_RAID_CONFIG)
     schema = json.loads(raid_constants.CUSTOM_RAID_SCHEMA)
     raid.validate_configuration(raid_config, raid_config_schema=schema)
Пример #11
0
 def test_validate_configuration_with_jbod_volume(self):
     raid_config = json.loads(raid_constants.RAID_CONFIG_JBOD_VOLUME)
     raid.validate_configuration(raid_config,
                                 raid_config_schema=self.schema)
Пример #12
0
 def test_validate_configuration_with_jbod_volume(self):
     raid_config = json.loads(raid_constants.RAID_CONFIG_JBOD_VOLUME)
     raid.validate_configuration(raid_config,
                                 raid_config_schema=self.schema)