vponomaryov | 82411ed | 2014-02-23 09:40:48 +0200 | [diff] [blame] | 1 | # Copyright 2012 OpenStack Foundation |
| 2 | # All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | # not use this file except in compliance with the License. You may obtain |
| 6 | # a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | # License for the specific language governing permissions and limitations |
| 14 | # under the License. |
| 15 | |
| 16 | from tempest.exceptions import base |
| 17 | |
| 18 | |
| 19 | class InvalidConfiguration(base.TempestException): |
| 20 | message = "Invalid Configuration" |
| 21 | |
| 22 | |
| 23 | class InvalidHttpSuccessCode(base.RestClientException): |
| 24 | message = "The success code is different than the expected one" |
| 25 | |
| 26 | |
| 27 | class NotFound(base.RestClientException): |
| 28 | message = "Object not found" |
| 29 | |
| 30 | |
| 31 | class Unauthorized(base.RestClientException): |
| 32 | message = 'Unauthorized' |
| 33 | |
| 34 | |
| 35 | class InvalidServiceTag(base.RestClientException): |
| 36 | message = "Invalid service tag" |
| 37 | |
| 38 | |
| 39 | class TimeoutException(base.TempestException): |
| 40 | message = "Request timed out" |
| 41 | |
| 42 | |
| 43 | class BuildErrorException(base.TempestException): |
| 44 | message = "Server %(server_id)s failed to build and is in ERROR status" |
| 45 | |
| 46 | |
| 47 | class ImageKilledException(base.TempestException): |
| 48 | message = "Image %(image_id)s 'killed' while waiting for '%(status)s'" |
| 49 | |
| 50 | |
| 51 | class AddImageException(base.TempestException): |
| 52 | message = "Image %(image_id)s failed to become ACTIVE in the allotted time" |
| 53 | |
| 54 | |
| 55 | class EC2RegisterImageException(base.TempestException): |
| 56 | message = ("Image %(image_id)s failed to become 'available' " |
| 57 | "in the allotted time") |
| 58 | |
| 59 | |
| 60 | class VolumeBuildErrorException(base.TempestException): |
| 61 | message = "Volume %(volume_id)s failed to build and is in ERROR status" |
| 62 | |
| 63 | |
| 64 | class SnapshotBuildErrorException(base.TempestException): |
| 65 | message = "Snapshot %(snapshot_id)s failed to build and is in ERROR status" |
| 66 | |
| 67 | |
| 68 | class VolumeBackupException(base.TempestException): |
| 69 | message = "Volume backup %(backup_id)s failed and is in ERROR status" |
| 70 | |
| 71 | |
| 72 | class StackBuildErrorException(base.TempestException): |
| 73 | message = ("Stack %(stack_identifier)s is in %(stack_status)s status " |
| 74 | "due to '%(stack_status_reason)s'") |
| 75 | |
| 76 | |
| 77 | class BadRequest(base.RestClientException): |
| 78 | message = "Bad request" |
| 79 | |
| 80 | |
| 81 | class UnprocessableEntity(base.RestClientException): |
| 82 | message = "Unprocessable entity" |
| 83 | |
| 84 | |
| 85 | class AuthenticationFailure(base.RestClientException): |
| 86 | message = ("Authentication with user %(user)s and password " |
| 87 | "%(password)s failed auth using tenant %(tenant)s.") |
| 88 | |
| 89 | |
| 90 | class EndpointNotFound(base.TempestException): |
| 91 | message = "Endpoint not found" |
| 92 | |
| 93 | |
| 94 | class RateLimitExceeded(base.TempestException): |
| 95 | message = "Rate limit exceeded" |
| 96 | |
| 97 | |
| 98 | class OverLimit(base.TempestException): |
| 99 | message = "Quota exceeded" |
| 100 | |
| 101 | |
| 102 | class ServerFault(base.TempestException): |
| 103 | message = "Got server fault" |
| 104 | |
| 105 | |
| 106 | class ImageFault(base.TempestException): |
| 107 | message = "Got image fault" |
| 108 | |
| 109 | |
| 110 | class IdentityError(base.TempestException): |
| 111 | message = "Got identity error" |
| 112 | |
| 113 | |
| 114 | class Conflict(base.RestClientException): |
| 115 | message = "An object with that identifier already exists" |
| 116 | |
| 117 | |
| 118 | class SSHTimeout(base.TempestException): |
| 119 | message = ("Connection to the %(host)s via SSH timed out.\n" |
| 120 | "User: %(user)s, Password: %(password)s") |
| 121 | |
| 122 | |
| 123 | class SSHExecCommandFailed(base.TempestException): |
| 124 | """Raised when remotely executed command returns nonzero status.""" |
| 125 | message = ("Command '%(command)s', exit status: %(exit_status)d, " |
| 126 | "Error:\n%(strerror)s") |
| 127 | |
| 128 | |
| 129 | class ServerUnreachable(base.TempestException): |
| 130 | message = "The server is not reachable via the configured network" |
| 131 | |
| 132 | |
| 133 | class TearDownException(base.TempestException): |
| 134 | message = "%(num)d cleanUp operation failed" |
| 135 | |
| 136 | |
| 137 | class ResponseWithNonEmptyBody(base.RFCViolation): |
| 138 | message = ("RFC Violation! Response with %(status)d HTTP Status Code " |
| 139 | "MUST NOT have a body") |
| 140 | |
| 141 | |
| 142 | class ResponseWithEntity(base.RFCViolation): |
| 143 | message = ("RFC Violation! Response with 205 HTTP Status Code " |
| 144 | "MUST NOT have an entity") |
| 145 | |
| 146 | |
| 147 | class InvalidHTTPResponseBody(base.RestClientException): |
| 148 | message = "HTTP response body is invalid json or xml" |
vponomaryov | 6cb6d19 | 2014-03-07 09:39:05 +0200 | [diff] [blame^] | 149 | |
| 150 | |
| 151 | class InvalidContentType(base.RestClientException): |
| 152 | message = "Invalid content type provided" |
| 153 | |
| 154 | |
| 155 | class UnexpectedResponseCode(base.RestClientException): |
| 156 | message = "Unexpected response code received" |