OS-373: Don't always use hostame pattern

Don't use hostname pattern for internal
Neutron services (DHCP agent, router, load balancer).

Change-Id: I802c380e148a766631062fd10b6aa576c84d7443
Delete network view only when it has no NIOS networks

Previously we deleted whole NIOS network view regardless of whether it
has networks or not.

Change-Id: I4a9155fe5eef9d359feb9a04672cb98495d71713

Conflicts:
	neutron/ddi/drivers/infoblox/ipam_controller.py

Conflicts:
	neutron/ipam/drivers/infoblox/ipam_controller.py
	neutron/tests/unit/ipam/drivers/infoblox/test_ipam_controller.py
OS-375: Add support for secondary DNS servers

When we specify dns_members field in conditional
configuration file as a list of grid members,
the first member will be used as a primary
DNS server, and all subsequent members - as
secondary DNS servers.

Change-Id: Ibe4f757b8ecf5ab36ce2af7c7668efc1b83f2067
Use 'port' instead of 'host' in ipam

In NeutronDbPluginV2 class we generate dictionary
called 'host' and use it when allocating and
deallocating ip addresses. It generated mainly
from port info and some other now deprecated data.
From ipam subsystem point of view it somewhat
confusing what this parameter actually means.

Change-Id: Ibd509c46bd863ba7d1b2c0133abb00323e37ce4f

Conflicts:
	neutron/db/db_base_plugin_v2.py
Fix issue with reserved DNS member

We expect reserve_dns_member method
to return list of reserver members.
However that's not always true, so
we need to hadle this case also.

Change-Id: I7a0c7ea9cb01cb4e984dbb49fda1fb08c8d9a21a
Fix pep8

Change-Id: Ie4e7d717b1a77d57f959ebb0346e74d86cd89fb9
OS-390: Use reserve_dns_members() properly

reserve_dns_members() returns a list of
grid members. Fix the code to handle the
result properly.

Change-Id: I1ddbef4c521dddddb0792997e4075c5eadce7d91
OS-397, OS-398: Add new extensible attributes

Add os_network_is_external and os_network_name
extensible attributes.

Change-Id: I7805ebf43a8ca89d61f2e894856f17130bed926a
OS-404: Set os_instance_id EA for floating ip

Change-Id: Ife2d62d74d29d57d99029db920ad06f4b32b423d
OS-390: Fix reserve_dns_members() one more time

Make sure reserve_dns_members() always returns
a list of members.

Change-Id: I0eac6ace3f85a759c5935018c69a1bcb96edc631
OS-389 Member gets released before it needs to be

Member used to be released on each subnet_delete action, which resulted
in inconsistent behavior in usecase where user creates several networks
and then deletes them one after another: member was released for the
first network deleted, and because of that for the following networks it
failed with member-related error message.

Change-Id: I983e7cb1e9633d0a3bf5ed6d1d54114ffdf4609f
OS-407: Don't always set os_instance_id EA

Don't set os_instance_id EA for DHCP agent,
Load Balancer and L3 Router ports.

Change-Id: I9b7423f0d7ea1e1ae416505349026dc182c0b730

Conflicts:
	neutron/ipam/drivers/infoblox/dns_controller.py
	neutron/ipam/drivers/infoblox/ea_manager.py
OS-378: Don't always update subnet name

Don't allow subnet name update if subnet_name
is specified in domain name pattern.

Change-Id: Ibf507bcc4cc2f6f65a8a28703bffd7b3c20f29ef
OS-405: Delete preconfigured DNS view if necessary

Delete preconfigured DNS view manualy on Neutron
network deletion if no more DNS zones left in
that view.

Change-Id: I2b295cd54ca85440eb665f7ce6571dc2427c1636
OS-402: Set EAs for fixedaddress Infoblox object

Change-Id: Iff9700fcab229aad10f2e5d0795dddb059242b7b
Fix pep8

Change-Id: I1fa687c3bb7e3243461d750d3adbf19aa5811734
OS-370 Reduce number of RESTART_IF_NEEDED calls

There are two reasons why RESTART_IF_NEEDED gets called so
frequently:
 * When neutron-dhcp-agent tries to create a dhcp-port, and fails to do
   so somewhere in neutron; This is usually caused by some internal
   neutron error caused by incorrect deployment;
 * Inside the DNSController.bind_names function, where it tries to
   restart services for each fixed address of the port.

Given that the first item cannot be fixed from the code, this patch
fixes the second issue and reduces the number of restart requests.

Change-Id: Ic20726fed99b6a193c7418ccf4ab2912b5bf4af3
OS-285 Use IP address in non-hostname pattern

In case neutron port has more than one IP address assigned, DNS name
which holds {port_id} as part of the hostname may be already defined.
This leads to a situation where DNS name cannot be assigned to
host-records other than the first one in port['fixed_address']. Using
{ip_address} as part of the hostname adds unique bit needed to overcome
this problem.

Change-Id: Ie2de17d8297f8741d1fc727d1cf53fd301ea0ea6
OS-414 Network deletion for subnet CIDR condition

When network gets deleted from Neutron, previously it checked the
configuration for it taken from network, but networks don't have any
CIDR associated with it, only subnet do. Changed the logic to do network
view deletion on delete_subnet() rather than delete_network().

Change-Id: I68d789bcc7e66e852012a7d9ac58a06cf7c3e755

Conflicts:
	neutron/ipam/drivers/infoblox/ipam_controller.py
OS-342 Handle network updates to update EAs

Network updates need to be handled to update extensible attributes on
NIOS mainly to support is_shared_network update.

Change-Id: I36bdade273871b7f15f4102f1c27d252336950c7

Conflicts:
	neutron/ipam/drivers/infoblox/ea_manager.py
	neutron/ipam/drivers/infoblox/ipam_controller.py