baremetal: Integrate provisioning and non-provisioning interfaces

Originally, baremetal pxe/tilera driver managed two types of network
interfaces in two tables; provisioning interfaces in bm_nodes table
and non-provisioning (normal) interfaces in bm_interfaces table.
But, now actually both types are handled in the same way and there is
no difference between them except for which table they are in.

This patch moves the provisioning interfaces to bm_interfaces. However
it does not drop prov_mac_address in bm_nodes since VirtualPowerManager
still uses it to identify a target in a list of VMs returned by the
VM's host.

Change-Id: I5ce940e7127aa3b29ba7802612938dc5dbc3152f
Define LOG globally in baremetal_deploy_helper

Since LOG = getLogger() has been moved from the global scope
to the function scope (main), the rest of the module could
not find LOG. This patch makes LOG global again.

Fixes bug 1165262

Change-Id: I2607802dcbed64135f75011a02ebce95519e4ea1
set timeout for paramiko ssh connection

set powervm connection timeout to 60 seconds
to eliminate crashing if ssh server is slow in
responding.

Change-Id: Ic7f4d092de73e73c6edb909713bf3a2347a50334
Fix error message in pre_live_migration.

We are using locals() to reference a variable which doesn't exist
in this error message. Also rename the instance variable while I
am here to be more consistent with other uses.

Resolves bug 1164072.

Change-Id: I96f5e2a81ac2e97181c3e87df83e19b381f4bcd2
Raise correct exception for duplicate networks

When using Quantum, if duplicate network ids are passed in on a
nova boot, nova-api raises a NetworkNotFound exception, which is
not correct.  This change causes it to raise a NetworkDuplicated
exception instead.

Fixes bug 1165088

Change-Id: I4f1f9aa5e1fa0e740b78e67760d924e2dd1d4d98
Imported Translations from Transifex

Change-Id: I91007468d2da94bb669931ad09dce4c2f5d3efad
Add NOVA_LOCALEDIR env variable

Part of fixing bug #995287

Syncs these two commits from oslo-incubator:

  Support overriding oslo localedir too
  Add a gettextutils.install() helper function

to get a new gettextutils.install() function which allows the default
localedir to be overwritten via an environment variable.

Note that gettextutils.install() must be called before any other nova
modules are imported since some modules attempt to translate strings
at import time (e.g. the 'message' attributes on classes in
nova.exception). This is broken and inefficient, but fixing it involves
adding something like spinx's l_() function and would be very invaisve.

Also, note that calling gettextutils.install() in nova.cmd.__init__
means that no program which uses a different translation domain should
ever import any of the modules under nova.cmd.

Change-Id: I86562b3a65d371673bb21f7179eecc7602bc0775
Remove multi scheduler.

This patch removes the multi scheduler.  It doesn't provide any value.
The only code that exists here is for passing through requests to the
compute scheduler.  There is nothing that uses the 'default' scheduler.

The only case where this code could have been useful is if it was
patched out of tree.  At that point, it seems easier to just provide
your own scheduler driver that does what you want instead of trying to
patch this one, IMO.

DocImpact: The multi scheduler no longer exists.

Change-Id: I30902d1ce0aa5baef6693dc4a3b1057cccb27841
Fix typo: libvir => libvirt

Fix in fakelibvirt test

Change-Id: I7969df6e04808f5c14386d197b73c6d9a1c7dd44
xenapi: Make _connect_volume exc handler eventlet safe

`forget_sr` blocks and so clears the exception state causing the
subsequent raise to try to raise `None`, which fails.

Fixes bug 1167515

Change-Id: I18562c7389b152a6490d352c5a8d36934288f47d
Replace metadata joins with another query

Right now, we always join metadata and system_metadata when we query for
instances. This inflates the number of rows returned by a factor of ten
at a minimum, and over 30 in some situations. This patch avoids the
direct join of these tables in favor of a "manual join" which performs
additional queries to fill the needed data. Latency may be increased,
but with the gain of a potentially significant amount of reduction in
data transfer.

This also provides the ability for the queries which utilize it to
selectively decide whether either or both of these additional fills are
performed, paving the way for future high-level optimizations.

Related to bug 1164737

Change-Id: I0610fb16ccce2ee95c318589c8abcc30613a3fe9
Change DB API instance functions for selective metadata fetching

This makes the DB API for instance_get_all() variants able to take a
columns_to_join parameter like the base instance_get_all() function,
which provides control over whether we go to the trouble of pulling
the metadata out of the database before we return the instances.

Related to bug 1164737

Change-Id: Ie7c012e2e12bb91ef4294cdc90d828af255b67c5
Optimize some of the periodic task database queries in n-cpu

There are a few trivial periodic tasks that can benefit from telling
the DB API (via conductor) not to fetch metadata items. This patch
makes those changes

Related to bug 1164737

Change-Id: I8e2730d3ed74bd7e0a0217647316c1cf492f22f3
Merge "Fix typo: libvir => libvirt"
Merge "Imported Translations from Transifex"
Merge "Fix error message in pre_live_migration."
Merge "baremetal: Integrate provisioning and non-provisioning interfaces"
Optimize some of compute/manager's periodic tasks' DB queries

Most of these tasks do not need to fetch instances with a full
complement of metadata items. Make them say "no thanks" to the DB API
to reduce the amount of work that needs to be done. Note some
refactoring was done in the _get_instance_nw_info() method to pull
this information if it ended up being necessary. The cases where this
would happen are error-cleanup scenarios, and thus taking the extra
hit in that case is an overall win for not having to do it all the
time.

Related to bug 1164737

Change-Id: Ic7d6290c0b7edf84cbf8bdc64e29f206619f97e5
Remove "undefined name" pyflake errors

A number of places tried to use undefined names. This included one
powervm test which turned out to not check anything at all (used
fake implementation of tested method) and needed to be moved.

Make sure that this class of errors causes run_pep8 failure in the
future.

Change-Id: I82ccb63bbc6f6d2b20ecb7f06b2fc22f8f034a33
Merge "set timeout for paramiko ssh connection"