Fix Exception message consistency with input protocol

when create security-rule protocol is udp,port range is not
1-65535,exception message display TCP port range is 1-65535,
this should display UDP port range is 1-65535

Change-Id: Ic15726a64948a83cde479f3991dbf45d702ff776
Closes-Bug: #1533486
This commit is contained in:
lei zhang 2015-12-08 00:36:59 +08:00
parent 34cf19c8a4
commit 82be39caf0
1 changed files with 3 additions and 2 deletions

View File

@ -110,8 +110,9 @@ class SecurityGroupBase(object):
if (ip_protocol.upper() in ['TCP', 'UDP'] and
(from_port < 1 or to_port > 65535)):
raise exception.InvalidPortRange(from_port=from_port,
to_port=to_port, msg="Valid TCP ports should"
" be between 1-65535")
to_port=to_port, msg="Valid %s ports should"
" be between 1-65535"
% ip_protocol.upper())
# Verify ICMP type and code
if (ip_protocol.upper() == "ICMP" and