diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-06-16 03:35:40 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-06-16 03:35:40 +0000 |
commit | 1c848cc8be8dc8753ab853d3fa01f7d86d65342b (patch) | |
tree | b4973a25d2091d2ccb799d0c14adc3c55f18e4d1 /trove/extensions | |
parent | 4a16721e071f1ce66cd5d5cd60279d01ece8de2d (diff) | |
parent | 91d443e06b50143a707235363bff9ab97d68a8f4 (diff) | |
download | trove-1c848cc8be8dc8753ab853d3fa01f7d86d65342b.tar.gz |
Merge "Improve list-of-ports validation"
Diffstat (limited to 'trove/extensions')
-rw-r--r-- | trove/extensions/security_group/service.py | 5 |
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) |