Exemplo n.º 1
0
    def validate(self, task):
        """Validate the driver-specific Node deployment info.

        :param task: a TaskManager instance
        :raises: MissingParameterValue if some parameters are missing.
        """

        driver_utils.validate_boot_mode_capability(task.node)
        driver_utils.validate_secure_boot_capability(task.node)
        _parse_driver_info(task.node)
Exemplo n.º 2
0
    def validate(self, task):
        """Validate the driver-specific Node deployment info.

        :param task: a TaskManager instance
        :raises: MissingParameterValue if some parameters are missing.
        """

        driver_utils.validate_boot_mode_capability(task.node)
        driver_utils.validate_secure_boot_capability(task.node)
        _parse_driver_info(task.node)
Exemplo n.º 3
0
    def validate(self, task):
        """Validate the deployment information for the task's node.

        :param task: a TaskManager instance containing the node to act on.
        :raises: InvalidParameterValue, if some information is invalid.
        :raises: MissingParameterValue if 'kernel_id' and 'ramdisk_id' are
            missing in the Glance image or 'kernel' and 'ramdisk' not provided
            in instance_info for non-Glance image.
        """
        iscsi_deploy.validate(task)
        node = task.node

        d_info = _parse_deploy_info(node)

        if node.driver_internal_info.get('is_whole_disk_image'):
            props = []
        elif service_utils.is_glance_image(d_info['image_source']):
            props = ['kernel_id', 'ramdisk_id']
        else:
            props = ['kernel', 'ramdisk']
        iscsi_deploy.validate_image_properties(task.context, d_info, props)
        driver_utils.validate_boot_mode_capability(node)
        driver_utils.validate_boot_option_capability(node)
        driver_utils.validate_secure_boot_capability(node)
Exemplo n.º 4
0
    def validate(self, task):
        """Validate the deployment information for the task's node.

        :param task: a TaskManager instance containing the node to act on.
        :raises: InvalidParameterValue, if some information is invalid.
        :raises: MissingParameterValue if 'kernel_id' and 'ramdisk_id' are
            missing in the Glance image or 'kernel' and 'ramdisk' not provided
            in instance_info for non-Glance image.
        """
        iscsi_deploy.validate(task)
        node = task.node

        d_info = _parse_deploy_info(node)

        if node.driver_internal_info.get('is_whole_disk_image'):
            props = []
        elif service_utils.is_glance_image(d_info['image_source']):
            props = ['kernel_id', 'ramdisk_id']
        else:
            props = ['kernel', 'ramdisk']
        iscsi_deploy.validate_image_properties(task.context, d_info, props)
        driver_utils.validate_boot_mode_capability(node)
        driver_utils.validate_boot_option_capability(node)
        driver_utils.validate_secure_boot_capability(node)
Exemplo n.º 5
0
    def test_validate_secure_boot_capability(self):
        properties = {'capabilities': 'secure_boot:true,cap2:value2'}
        self.node.properties = properties

        result = driver_utils.validate_secure_boot_capability(self.node)
        self.assertIsNone(result)
Exemplo n.º 6
0
    def test_validate_secure_boot_capability(self):
        properties = {'capabilities': 'secure_boot:true,cap2:value2'}
        self.node.properties = properties

        result = driver_utils.validate_secure_boot_capability(self.node)
        self.assertIsNone(result)