Merge "Fixed for bug : 1171 - issue while creating subnet"
authorEd Warnicke <eaw@cisco.com>
Fri, 1 Aug 2014 02:33:46 +0000 (02:33 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 1 Aug 2014 02:33:46 +0000 (02:33 +0000)
1  2 
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet.java

@@@ -25,7 -25,7 +25,7 @@@ import org.opendaylight.controller.conf
  @XmlRootElement
  @XmlAccessorType(XmlAccessType.NONE)
  
 -public class NeutronSubnet extends ConfigurationObject implements Serializable {
 +public class NeutronSubnet extends ConfigurationObject implements Serializable, INeutronObject {
      private static final long serialVersionUID = 1L;
  
      // See OpenStack Network API v2.0 Reference for description of
@@@ -75,7 -75,7 +75,7 @@@
       */
      List<NeutronPort> myPorts;
  
 -    boolean gatewayIPAssigned;
 +    Boolean gatewayIPAssigned;
  
      public NeutronSubnet() {
          myPorts = new ArrayList<NeutronPort>();
@@@ -83,8 -83,6 +83,8 @@@
  
      public String getID() { return subnetUUID; }
  
 +    public void setID(String id) { this.subnetUUID = id; }
 +
      public String getSubnetUUID() {
          return subnetUUID;
      }
              try {
                  SubnetUtils util = new SubnetUtils(cidr);
                  SubnetInfo info = util.getInfo();
-                 if (gatewayIP == null) {
+                 if (gatewayIP == null || ("").equals(gatewayIP)) {
                      gatewayIP = info.getLowAddress();
                  }
                  if (allocationPools.size() < 1) {
          gatewayIPAssigned = false;
      }
  
 +    public Boolean getGatewayIPAllocated() {
 +        return gatewayIPAssigned;
 +    }
 +
      @Override
      public String toString() {
          return "NeutronSubnet [subnetUUID=" + subnetUUID + ", networkUUID=" + networkUUID + ", name=" + name

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.