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

index d032d2e8acf7f1694da85b7fec18a0623176962d,f31b045e93da60a50b305b1a51b18db4b7776b61..1f10b395137c498b3e542e974545132332e84be4
@@@ -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