How to use the nova.exception.Invalid function in nova

To help you get started, we’ve selected a few nova examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openstack / nova / nova / exception.py View on Github external
class PortBindingDeletionFailed(NovaException):
    msg_fmt = _("Failed to delete binding for port %(port_id)s and host "
                "%(host)s.")


class PortBindingActivationFailed(NovaException):
    msg_fmt = _("Failed to activate binding for port %(port_id)s and host "
                "%(host)s.")


class PortUpdateFailed(Invalid):
    msg_fmt = _("Port update failed for port %(port_id)s: %(reason)s")


class AttachSRIOVPortNotSupported(Invalid):
    msg_fmt = _('Attaching SR-IOV port %(port_id)s to server '
                '%(instance_uuid)s is not supported. SR-IOV ports must be '
                'specified during server creation.')


class FixedIpExists(NovaException):
    msg_fmt = _("Fixed IP %(address)s already exists.")


class FixedIpNotFound(NotFound):
    msg_fmt = _("No fixed IP associated with id %(id)s.")


class FixedIpNotFoundForAddress(FixedIpNotFound):
    msg_fmt = _("Fixed IP not found for address %(address)s.")
github openstack / nova / nova / exception.py View on Github external
class SecurityGroupNotFoundForRule(SecurityGroupNotFound):
    msg_fmt = _("Security group with rule %(rule_id)s not found.")


class SecurityGroupExists(Invalid):
    msg_fmt = _("Security group %(security_group_name)s already exists "
                "for project %(project_id)s.")


class SecurityGroupExistsForInstance(Invalid):
    msg_fmt = _("Security group %(security_group_id)s is already associated"
                " with the instance %(instance_id)s")


class SecurityGroupNotExistsForInstance(Invalid):
    msg_fmt = _("Security group %(security_group_id)s is not associated with"
                " the instance %(instance_id)s")


class SecurityGroupCannotBeApplied(Invalid):
    msg_fmt = _("Network requires port_security_enabled and subnet associated"
                " in order to apply security groups.")


class NoUniqueMatch(NovaException):
    msg_fmt = _("No Unique Match Found.")
    code = 409


class NoActiveMigrationForInstance(NotFound):
    msg_fmt = _("Active live migration for instance %(instance_id)s not found")
github openstack / nova / nova / exception.py View on Github external
msg_fmt = _("Failed to deploy instance: %(reason)s")


class MultiplePortsNotApplicable(Invalid):
    msg_fmt = _("Failed to launch instances: %(reason)s")


class InvalidFixedIpAndMaxCountRequest(Invalid):
    msg_fmt = _("Failed to launch instances: %(reason)s")


class ServiceUnavailable(Invalid):
    msg_fmt = _("Service is unavailable at this time.")


class ServiceNotUnique(Invalid):
    msg_fmt = _("More than one possible service found.")


class ComputeResourcesUnavailable(ServiceUnavailable):
    msg_fmt = _("Insufficient compute resources: %(reason)s.")


class HypervisorUnavailable(NovaException):
    msg_fmt = _("Connection to the hypervisor is broken on host: %(host)s")


class ComputeServiceUnavailable(ServiceUnavailable):
    msg_fmt = _("Compute service of %(host)s is unavailable at this time.")


class ComputeServiceInUse(NovaException):
github openstack / nova / nova / exception.py View on Github external
class InvalidBDMForLegacy(InvalidBDM):
    msg_fmt = _("Block Device Mapping cannot "
                "be converted to legacy format. ")


class InvalidBDMVolumeNotBootable(InvalidBDM):
    msg_fmt = _("Block Device %(id)s is not bootable.")


class TooManyDiskDevices(InvalidBDM):
    msg_fmt = _('The maximum allowed number of disk devices (%(maximum)d) to '
                'attach to a single instance has been exceeded.')
    code = 403


class InvalidAttribute(Invalid):
    msg_fmt = _("Attribute not supported: %(attr)s")


class ValidationError(Invalid):
    msg_fmt = "%(detail)s"


class VolumeAttachFailed(Invalid):
    msg_fmt = _("Volume %(volume_id)s could not be attached. "
                "Reason: %(reason)s")


class VolumeDetachFailed(Invalid):
    msg_fmt = _("Volume %(volume_id)s could not be detached. "
                "Reason: %(reason)s")
github openstack / nova / nova / exception.py View on Github external
class InvalidImageConfigDrive(Invalid):
    msg_fmt = _("Image's config drive option '%(config_drive)s' is invalid")


class InvalidHypervisorVirtType(Invalid):
    msg_fmt = _("Hypervisor virtualization type '%(hv_type)s' is not "
                "recognised")


class InvalidMachineType(Invalid):
    msg_fmt = _("Machine type '%(mtype)s' is not compatible with image "
                "%(image_name)s (%(image_id)s): %(reason)s")


class InvalidVirtualMachineMode(Invalid):
    msg_fmt = _("Virtual machine mode '%(vmmode)s' is not recognised")


class InvalidToken(Invalid):
    msg_fmt = _("The token '%(token)s' is invalid or has expired")


class TokenInUse(Invalid):
    msg_fmt = _("The generated token is invalid")


class InvalidConnectionInfo(Invalid):
    msg_fmt = _("Invalid Connection Info")


class InstanceQuiesceNotSupported(Invalid):
github openstack / nova / nova / exception.py View on Github external
class InvalidCPUAllocationPolicy(Invalid):
    msg_fmt = _("CPU policy requested from '%(source)s' is invalid, "
                "given: '%(requested)s', available: '%(available)s'.")


class InvalidCPUThreadAllocationPolicy(Invalid):
    msg_fmt = _("CPU thread policy requested from '%(source)s' is invalid, "
                "given: '%(requested)s', available: '%(available)s'.")


class BadRequirementEmulatorThreadsPolicy(Invalid):
    msg_fmt = _("An isolated CPU emulator threads option requires a dedicated "
                "CPU policy option.")


class InvalidNetworkNUMAAffinity(Invalid):
    msg_fmt = _("Invalid NUMA network affinity configured: %(reason)s")


class PowerVMAPIFailed(NovaException):
    msg_fmt = _("PowerVM API failed to complete for instance=%(inst_name)s.  "
                "%(reason)s")


class TraitRetrievalFailed(NovaException):
    msg_fmt = _("Failed to retrieve traits from the placement API: %(error)s")


class TraitCreationFailed(NovaException):
    msg_fmt = _("Failed to create trait %(name)s: %(error)s")
github openstack / nova / nova / exception.py View on Github external
msg_fmt = _("CPU and memory allocation must be provided for all "
                "NUMA nodes")


class ImageNUMATopologyForbidden(Forbidden):
    msg_fmt = _("Image property '%(name)s' is not permitted to override "
                "NUMA configuration set against the flavor")


class ImageNUMATopologyRebuildConflict(Invalid):
    msg_fmt = _(
        "An instance's NUMA typology cannot be changed as part of a rebuild. "
        "The image provided is invalid for this instance.")


class ImageNUMATopologyAsymmetric(Invalid):
    msg_fmt = _("Instance CPUs and/or memory cannot be evenly distributed "
                "across instance NUMA nodes. Explicit assignment of CPUs "
                "and memory to nodes is required")


class ImageNUMATopologyCPUOutOfRange(Invalid):
    msg_fmt = _("CPU number %(cpunum)d is larger than max %(cpumax)d")


class ImageNUMATopologyCPUDuplicates(Invalid):
    msg_fmt = _("CPU number %(cpunum)d is assigned to two nodes")


class ImageNUMATopologyCPUsUnassigned(Invalid):
    msg_fmt = _("CPU number %(cpuset)s is not assigned to any node")
github openstack / nova / nova / exception.py View on Github external
class UndefinedRootBDM(NovaException):
    msg_fmt = _("Undefined Block Device Mapping root: BlockDeviceMappingList "
                "contains Block Device Mappings from multiple instances.")


class BDMNotFound(NotFound):
    msg_fmt = _("No Block Device Mapping with id %(id)s.")


class VolumeBDMNotFound(NotFound):
    msg_fmt = _("No volume Block Device Mapping with id %(volume_id)s.")


class VolumeBDMIsMultiAttach(Invalid):
    msg_fmt = _("Block Device Mapping %(volume_id)s is a multi-attach volume"
                " and is not valid for this operation.")


class VolumeBDMPathNotFound(VolumeBDMNotFound):
    msg_fmt = _("No volume Block Device Mapping at path: %(path)s")


class DeviceDetachFailed(NovaException):
    msg_fmt = _("Device detach failed for %(device)s: %(reason)s")


class DeviceNotFound(NotFound):
    msg_fmt = _("Device '%(device)s' not found.")
github openstack / nova / nova / exception.py View on Github external
class RealtimeMaskNotFoundOrInvalid(Invalid):
    msg_fmt = _("Realtime policy needs vCPU(s) mask configured with at least "
                "1 RT vCPU and 1 ordinary vCPU. See hw:cpu_realtime_mask "
                "or hw_cpu_realtime_mask")


class OsInfoNotFound(NotFound):
    msg_fmt = _("No configuration information found for operating system "
                "%(os_name)s")


class BuildRequestNotFound(NotFound):
    msg_fmt = _("BuildRequest not found for instance %(uuid)s")


class AttachInterfaceNotSupported(Invalid):
    msg_fmt = _("Attaching interfaces is not supported for "
                "instance %(instance_uuid)s.")


class AttachInterfaceWithQoSPolicyNotSupported(AttachInterfaceNotSupported):
    msg_fmt = _("Attaching interfaces with QoS policy is not supported for "
                "instance %(instance_uuid)s.")


class NetworksWithQoSPolicyNotSupported(Invalid):
    msg_fmt = _("Using networks with QoS policy is not supported for "
                "instance %(instance_uuid)s. (Network ID is %(network_id)s)")


class CreateWithPortResourceRequestOldVersion(Invalid):
    msg_fmt = _("Creating servers with ports having resource requests, like a "
github openstack / nova / nova / exception.py View on Github external
class HostBinaryNotFound(NotFound):
    msg_fmt = _("Could not find binary %(binary)s on host %(host)s.")


class InvalidReservationExpiration(Invalid):
    msg_fmt = _("Invalid reservation expiration %(expire)s.")


class InvalidQuotaValue(Invalid):
    msg_fmt = _("Change would make usage less than 0 for the following "
                "resources: %(unders)s")


class InvalidQuotaMethodUsage(Invalid):
    msg_fmt = _("Wrong quota method %(method)s used on resource %(res)s")


class QuotaNotFound(NotFound):
    msg_fmt = _("Quota could not be found")


class QuotaExists(NovaException):
    msg_fmt = _("Quota exists for project %(project_id)s, "
                "resource %(resource)s")


class QuotaResourceUnknown(QuotaNotFound):
    msg_fmt = _("Unknown quota resources %(unknown)s.")