summaryrefslogtreecommitdiff
path: root/trove/extensions
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-16 03:35:40 +0000
committerGerrit Code Review <review@openstack.org>2017-06-16 03:35:40 +0000
commit1c848cc8be8dc8753ab853d3fa01f7d86d65342b (patch)
treeb4973a25d2091d2ccb799d0c14adc3c55f18e4d1 /trove/extensions
parent4a16721e071f1ce66cd5d5cd60279d01ece8de2d (diff)
parent91d443e06b50143a707235363bff9ab97d68a8f4 (diff)
downloadtrove-1c848cc8be8dc8753ab853d3fa01f7d86d65342b.tar.gz
Merge "Improve list-of-ports validation"
Diffstat (limited to 'trove/extensions')
-rw-r--r--trove/extensions/security_group/service.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/trove/extensions/security_group/service.py b/trove/extensions/security_group/service.py
index a79dce6d..3a4a837d 100644
--- a/trove/extensions/security_group/service.py
+++ b/trove/extensions/security_group/service.py
@@ -19,7 +19,6 @@ from oslo_log import log as logging
from trove.common import cfg
from trove.common import exception
from trove.common.i18n import _
-from trove.common import utils
from trove.common import wsgi
from trove.datastore.models import DatastoreVersion
from trove.extensions.security_group import models
@@ -105,9 +104,9 @@ class SecurityGroupRuleController(wsgi.Controller):
rules = []
try:
for port_or_range in set(ports):
- from_, to_ = utils.gen_ports(port_or_range)
+ from_, to_ = port_or_range[0], port_or_range[-1]
rule = models.SecurityGroupRule.create_sec_group_rule(
- sec_group, protocol, int(from_), int(to_),
+ sec_group, protocol, from_, to_,
body['security_group_rule']['cidr'], context,
CONF.os_region_name)
rules.append(rule)