Neutron port ranges only compared when present.

Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/44c5053e
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/44c5053e
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/44c5053e

Branch: refs/heads/master
Commit: 44c5053e09ca1dc2601ee12c36e41ccdf06fc44c
Parents: 70a409f
Author: Zack Shoylev <[email protected]>
Authored: Fri Mar 27 07:04:20 2015 -0500
Committer: Zack Shoylev <[email protected]>
Committed: Thu Apr 2 17:33:56 2015 -0500

----------------------------------------------------------------------
 .../java/org/jclouds/openstack/neutron/v2/domain/Rule.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/44c5053e/apis/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/Rule.java
----------------------------------------------------------------------
diff --git 
a/apis/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/Rule.java
 
b/apis/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/Rule.java
index 89e9d19..e72a3e9 100644
--- 
a/apis/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/Rule.java
+++ 
b/apis/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/Rule.java
@@ -367,8 +367,10 @@ public class Rule {
          super(rule);
          checkNotNull(this.getDirection(), "direction should not be null");
          checkNotNull(this.getSecurityGroupId(), "security group id should not 
be null");
-         checkArgument(this.getPortRangeMax() >= this.getPortRangeMin(),
-               "port range max should be greater than or equal to port range 
min");
+         if (this.getPortRangeMax() != null && this.getPortRangeMin() != null) 
{
+            checkArgument(this.getPortRangeMax() >= this.getPortRangeMin(),
+                  "port range max should be greater than or equal to port 
range min");
+         }
          checkArgument(this.getRemoteGroupId() == null || 
this.getRemoteIpPrefix() == null,
                "You can specify either remote_group_id or remote_ip_prefix in 
the request body.");
       }

Reply via email to