Merge "Remove EC2 postfix from InvalidInstanceIDMalformedEC2"

This commit is contained in:
Jenkins 2013-09-03 21:10:17 +00:00 committed by Gerrit Code Review
commit 844a7f7fd6
4 changed files with 6 additions and 6 deletions

View File

@ -581,7 +581,7 @@ class Executor(wsgi.Application):
exception.InvalidPortRange,
exception.QuotaError,
exception.MissingParameter,
exception.InvalidInstanceIDMalformedEC2) as ex:
exception.InvalidInstanceIDMalformed) as ex:
return ec2_error_ex(ex, req)
except Exception as ex:
return ec2_error_ex(ex, req, unexpected=True)

View File

@ -88,11 +88,11 @@ QUOTAS = quota.QUOTAS
def validate_ec2_id(val):
if not validator.validate_str()(val):
raise exception.InvalidInstanceIDMalformedEC2(val=val)
raise exception.InvalidInstanceIDMalformed(val=val)
try:
ec2utils.ec2_id_to_id(val)
except exception.InvalidEc2Id:
raise exception.InvalidInstanceIDMalformedEC2(val=val)
raise exception.InvalidInstanceIDMalformed(val=val)
# EC2 API can return the following values as documented in the EC2 API

View File

@ -1190,7 +1190,7 @@ class MarkerNotFound(NotFound):
msg_fmt = _("Marker %(marker)s could not be found.")
class InvalidInstanceIDMalformedEC2(Invalid):
class InvalidInstanceIDMalformed(Invalid):
ec2_code = 'InvalidInstanceID.Malformed'
msg_fmt = _("Invalid id: %(val)s (expecting \"i-...\").")

View File

@ -69,12 +69,12 @@ class EC2ValidateTestCase(test.TestCase):
self.EC2_VALID__IDS = ['i-284f3a41', 'i-001', 'i-deadbeef']
self.ec2_id_exception_map = [(x,
exception.InvalidInstanceIDMalformedEC2)
exception.InvalidInstanceIDMalformed)
for x in self.EC2_MALFORMED_IDS]
self.ec2_id_exception_map.extend([(x, exception.InstanceNotFound)
for x in self.EC2_VALID__IDS])
self.volume_id_exception_map = [(x,
exception.InvalidInstanceIDMalformedEC2)
exception.InvalidInstanceIDMalformed)
for x in self.EC2_MALFORMED_IDS]
self.volume_id_exception_map.extend([(x, exception.VolumeNotFound)
for x in self.EC2_VALID__IDS])