def validate_supported_capabilities(self, capabilities):
        logger.info("validate_supported_capabilities for capabilities : {0}".format(capabilities))
        # for a9k there should be no capabilities
        if capabilities or len(capabilities) > 0:
            raise controller_errors.StorageClassCapabilityNotSupported(capabilities)

        logger.info("Finished validate_supported_capabilities")
    def validate_supported_capabilities(self, capabilities):
        logger.debug("Validating capabilities: {0}".format(capabilities))

        # Currently, we only support one capability "SpaceEfficiency"
        # The value should be: "thin"
        if (capabilities and capabilities.get(
                config.CAPABILITIES_SPACEEFFICIENCY).lower() not in [
                    config.CAPABILITY_THIN,
                ]):
            logger.error("capabilities is not supported.")
            raise array_errors.StorageClassCapabilityNotSupported(capabilities)

        logger.debug("Finished validating capabilities.")
Ejemplo n.º 3
0
    def validate_supported_capabilities(self, capabilities):
        logger.debug("validate_supported_capabilities for "
                     "capabilities : {0}".format(capabilities))
        # Currently, we only support one capability "SpaceEfficiency"
        # The value should be: "thin/thick/compressed/deduplicated"
        if (capabilities and capabilities.get(
                config.CAPABILITIES_SPACEEFFICIENCY).lower() not in
                [config.CAPABILITY_THIN, config.CAPABILITY_THICK,
                 config.CAPABILITY_COMPRESSED,
                 config.CAPABILITY_DEDUPLICATED]):
            logger.error("capability value is not "
                         "supported {0}".format(capabilities))
            raise controller_errors.StorageClassCapabilityNotSupported(
                capabilities)

        logger.info("Finished validate_supported_capabilities")
 def test_create_volume_with_create_volume_with_capability_not_supported_exception(
         self):
     self.create_volume_returns_error(
         return_code=grpc.StatusCode.INVALID_ARGUMENT,
         err=array_errors.StorageClassCapabilityNotSupported(["cap"]))