Comment 2 for bug 1670666

Revision history for this message
Dong Jun (dongj) wrote : Re: Support native DHCP servie for subnet without gateway IP

A DHCP port will be created to obtain the server IP without the gateway IP, maybe we can think of a better idea.

            # Create DHCP port
            port_dict = {
                'name': '',
                'admin_state_up': True,
                'device_id': 'dhcp-' + subnet['id'],
                'device_owner': const.DEVICE_OWNER_DHCP,
                'network_id': subnet['network_id'],
                'tenant_id': '',
                'mac_address': const.ATTR_NOT_SPECIFIED,
                'fixed_ips': [{'subnet_id': subnet['id']}]}
            try:
                dhcp_port = self._plugin.create_port(ctx, {'port': port_dict})