make get_by_host use slave in periodic task

In periodic task functions nova prefer to use slave db
instead of primary db. This patch makes function
_get_host_volume_bdms to use slave db

Change-Id: Ia297524fc1acf06ab708509c805d14e215b10b86
Rename private functions in db.sqla.api

instance_get_all_by_filters() called 3 helper functions: exact_filter,
regex_filter and tag_filter. None of these functions had any other
callers.

This change prefixes them with _ to identify them as private.
Additionally, it removes the model arguments to the functions as these
always relate to an Instance and/or its InstanceMetadata.
Consequently, the functions are renamed to identify them as specific
to an Instance query. exact_filter is moved from the top of the module
to be next to the other 2.

Change-Id: I671315122438022b13d6b315b577ef2a5cf42545
Indicate whether service is down for mc driver

memcache driver for service didn't log any clue
whether the service is down or not. This patch add a
log to indicate it at DEBUG level.

Closes-Bug: #1382564

Change-Id: I05e12b56411f4475d1ef50e90e09abf75d7355b0
Only filter once for trusted filters

In spawn process the filters will be used only once if the
run_filter_once_per_request is set to True. This apply to the hosts
that will not be affected by previous instance resource consumption.
Trusted filter should be in this kind of filters.

Change-Id: Ia223797798679fecfcf90983ca81a9f395e67c3b
Remove old Baremetal Host Manager

Baremetal was deprecated in Juno and its driver was removed in
46ed619b9ab1d61582f36155eea0d4a88f31fd50

This cleans out the parts that's still left in the scheduler.

Change-Id: I86f583f7d0747a164dae4530e25f8b01c2144673
Remove the volume api related useless policy rules

There are some old policy rules used by old nova volume, those are
useless anymore, this patch clean them up.

Change-Id: Ibcdba00652808158019600f8ad75e80c85f9423e
Closes-Bug: #1398686
Replacement `_` on `_LW` in all LOG.warning part 3

oslo.i18n uses different marker functions to separate the
translatable messages into different catalogs, which the translation
teams can prioritize translating. For details, please refer to:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html#guidelines-for-use-in-openstack

There were not marker fuctions some places in directory network.
This commit makes changes:
* Add missing marker functions
* Use ',' instead of '%' while adding variables to log messages

Change-Id: I14bb1fbf7044769697024b03c965ed9d70ab69c1
Replacement `_` on `_LW` in all LOG.warning part 4

oslo.i18n uses different marker functions to separate the
translatable messages into different catalogs, which the translation
teams can prioritize translating. For details, please refer to:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html#guidelines-for-use-in-openstack

There were not marker fuctions some places in directory network.
This commit makes changes:
* Add missing marker functions
* Use ',' instead of '%' while adding variables to log messages

Change-Id: I913077d3b0fdee78e423c35b3a48137a17946a7b
Assert order of DB index members

Order of columns can matter. Most SQL databases can use the leading
columns for optimizing queries that don't include all of the columns.
Ignoring the order can result in an index being added that may not
be able to be used to optimize the same queries.

Change-Id: Ie827aaacbcfbc01e32591d29aab79ef75aa0c5d9
Fix long hostname in dnsmasq

dnsmasq only supports 63 character hostnames. Longer names cause
dnsmasq to ignore the entry and not hand out a DHCP address.

Trunacte hostnames longer then 63 characters in order to make
DHCP work.

Closes-Bug: #1238910
Change-Id: Ie1697577bc14038faccd50caf2fea20cac342388
Adds global API version check for microversions

Adds a check for a request that the version requested is within the
global API version range supported by the REST API. Both the minimum
and maximum are currently set to "2.1". The maximum will be increased
everytime an API change is made.

Also sets up some template/doc files for clearly documenting
the REST API changes with each microversion increment.

Partially implements blueprint api-microversions

Change-Id: Ie7fdb2928d957c03ed788c2ddd29fe798c645fce
Workflow documentation is now in infra-manual

Replace URLs for workflow documentation to appropriate parts of the
OpenStack Project Infrastructure Manual.

Change-Id: Ice00abcbb431b29e28beb0cd8810b8653ef66139
Fixes multi-line strings with missing spaces

Multi-line concatenated strings are easily given bad spacing:

  "This looks like"
  "it will be OK"    => "This looks likeit will be OK"

This patch fixes those. I don't think it's possible to create
a hacking rule for this as any automated check will generate
too many false positives.

Change-Id: If89007f45d90ca5321336e3623139f9538ac06b8
Remove except Exception cases

Replaced 'except Exception' cases with the specific exceptions
that the given code can throw in the util module. In some cases
we added extra unit test to cover the specific exception.

Change-Id: I980237ed9d27f122b4725b8c05015a81764dd6b8
Partial-Bug: #1223605
Merge "Indicate whether service is down for mc driver"
Merge "make get_by_host use slave in periodic task"
Merge "Only filter once for trusted filters"
Merge "Fixes multi-line strings with missing spaces"
Remove needless workaround in utils module

Workaround for bug in netaddr library has been removed due to the fix
was introduced in 0.7.6 and nova currently requires 0.7.12 or newer version.

Change-Id: If83cd8ee770d57547f4cfcdbba4a9fbfd55d5983
Related-Bug: #957708
Libvirt normalize numa cell ids

This patch normalizes the cell ids before writing xml.
As cell ids are used to store host cell association,
they need to be normalized before writing xml, or otherwise
the xml will be invalid.

Change-Id: I9b565670f5b0ad24c7a5ff1853648594643b4c7a
Closes-bug: #1397381