21135855 Enable gateway-less external networks
authorGirish Moodalbail <Girish.Moodalbail@oracle.COM>
Thu, 18 Jun 2015 22:21:14 -0700
changeset 4507 76c2e35382f6
parent 4505 66ff214a993c
child 4510 522eaa890fe6
21135855 Enable gateway-less external networks
components/openstack/neutron/files/evs/plugin.py
--- a/components/openstack/neutron/files/evs/plugin.py	Thu Jun 18 10:51:36 2015 -0700
+++ b/components/openstack/neutron/files/evs/plugin.py	Thu Jun 18 22:21:14 2015 -0700
@@ -259,15 +259,6 @@
          IPnet associated with the EVS.
         """
 
-        # TODO(gmoodalb): Take care of this now that we have pool.
-        # Even though EVS does not support allocation pools, it is OK for an
-        # user to specify --allocation-pool because allocation pool management
-        # is done by neutron-server and is transparent to EVS framework.
-
-        # user specified --no-gateway, and we don't support it
-        if subnet['subnet']['gateway_ip'] is None:
-            raise EVSOpNotSupported(_("setting --no-gateway for a subnet "
-                                      "not supported"))
         if (subnet['subnet']['host_routes'] is not
                 attributes.ATTR_NOT_SPECIFIED):
             raise EVSOpNotSupported(_("setting --host-route for a subnet "
@@ -285,7 +276,10 @@
             evsname = db_subnet['network_id']
             tenantname = db_subnet['tenant_id']
             proplist = ['subnet=%s' % db_subnet['cidr']]
-            proplist.append('defrouter=%s' % db_subnet['gateway_ip'])
+            defrouter = db_subnet['gateway_ip']
+            if not defrouter:
+                defrouter = '0.0.0.0' if db_subnet['ip_version'] == 4 else '::'
+            proplist.append('defrouter=%s' % defrouter)
             proplist.append('uuid=%s' % db_subnet['id'])
             if poolstr:
                 proplist.append('pool=%s' % (poolstr))