From 4f2028439fae340f45e4c63f628484795a2a8b3d Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 19 Jun 2015 17:17:46 -0400 Subject: [PATCH] Use int in the parameter list instead of casting --- .../modules/cloud/openstack/os_security_group_rule.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/cloud/openstack/os_security_group_rule.py b/lib/ansible/modules/cloud/openstack/os_security_group_rule.py index 64187a60b7..065d593357 100644 --- a/lib/ansible/modules/cloud/openstack/os_security_group_rule.py +++ b/lib/ansible/modules/cloud/openstack/os_security_group_rule.py @@ -96,8 +96,8 @@ def _find_matching_rule(module, secgroup): :returns: The matching rule dict, or None if no matches. """ protocol = module.params['protocol'] - port_range_min = int(module.params['port_range_min']) - port_range_max = int(module.params['port_range_max']) + port_range_min = module.params['port_range_min'] + port_range_max = module.params['port_range_max'] remote_ip_prefix = module.params['remote_ip_prefix'] ethertype = module.params['ethertype'] direction = module.params['direction'] @@ -145,8 +145,8 @@ def main(): security_group = dict(required=True), protocol = dict(default='tcp', choices=['tcp', 'udp', 'icmp']), - port_range_min = dict(required=True), - port_range_max = dict(required=True), + port_range_min = dict(required=True, type='int'), + port_range_max = dict(required=True, type='int'), remote_ip_prefix = dict(required=False, default=None), # TODO(mordred): Make remote_group handle name and id remote_group = dict(required=False, default=None), @@ -214,4 +214,4 @@ def main(): from ansible.module_utils.basic import * from ansible.module_utils.openstack import * -main() \ No newline at end of file +main()