equal
deleted
inserted
replaced
257 IPnet can be associated with an EVS. All the zones/VNICs that |
257 IPnet can be associated with an EVS. All the zones/VNICs that |
258 connect to the EVS, through a VPort, will get an IP address from the |
258 connect to the EVS, through a VPort, will get an IP address from the |
259 IPnet associated with the EVS. |
259 IPnet associated with the EVS. |
260 """ |
260 """ |
261 |
261 |
262 # TODO(gmoodalb): Take care of this now that we have pool. |
|
263 # Even though EVS does not support allocation pools, it is OK for an |
|
264 # user to specify --allocation-pool because allocation pool management |
|
265 # is done by neutron-server and is transparent to EVS framework. |
|
266 |
|
267 # user specified --no-gateway, and we don't support it |
|
268 if subnet['subnet']['gateway_ip'] is None: |
|
269 raise EVSOpNotSupported(_("setting --no-gateway for a subnet " |
|
270 "not supported")) |
|
271 if (subnet['subnet']['host_routes'] is not |
262 if (subnet['subnet']['host_routes'] is not |
272 attributes.ATTR_NOT_SPECIFIED): |
263 attributes.ATTR_NOT_SPECIFIED): |
273 raise EVSOpNotSupported(_("setting --host-route for a subnet " |
264 raise EVSOpNotSupported(_("setting --host-route for a subnet " |
274 "not supported")) |
265 "not supported")) |
275 |
266 |
283 if not ipnetname: |
274 if not ipnetname: |
284 ipnetname = None |
275 ipnetname = None |
285 evsname = db_subnet['network_id'] |
276 evsname = db_subnet['network_id'] |
286 tenantname = db_subnet['tenant_id'] |
277 tenantname = db_subnet['tenant_id'] |
287 proplist = ['subnet=%s' % db_subnet['cidr']] |
278 proplist = ['subnet=%s' % db_subnet['cidr']] |
288 proplist.append('defrouter=%s' % db_subnet['gateway_ip']) |
279 defrouter = db_subnet['gateway_ip'] |
|
280 if not defrouter: |
|
281 defrouter = '0.0.0.0' if db_subnet['ip_version'] == 4 else '::' |
|
282 proplist.append('defrouter=%s' % defrouter) |
289 proplist.append('uuid=%s' % db_subnet['id']) |
283 proplist.append('uuid=%s' % db_subnet['id']) |
290 if poolstr: |
284 if poolstr: |
291 proplist.append('pool=%s' % (poolstr)) |
285 proplist.append('pool=%s' % (poolstr)) |
292 self._evs_controller_addIPnet(tenantname, evsname, ipnetname, |
286 self._evs_controller_addIPnet(tenantname, evsname, ipnetname, |
293 ",".join(proplist)) |
287 ",".join(proplist)) |