Config drive: delete deprecated config var config_drive_tempdir

Commit 6e15d787fffcef8c4299fbaf1d5c715af1a34fa2 removed the use
of this configuration variable.

Change-Id: Ifd5baa8b7d579b0959cdb57b1335380a4129d652
Revert "Truncate encoded instance message to 255"

This reverts commit bd9c32289ff8cf1bc67c1395ad921c703aa4c489.

UTF-8 character bytes size varies from 1 to 6. If truncating a long
bytes string to 255, the last character may be cut in the middle,
so that UnicodeDecodeError will occur when converting it back to
unicode. Need to revert this code change and make a new patch.

Related-Bug: 1389102

Change-Id: Ie439cffe11d657e77397c9070a3923a61f68a678
Truncate encoded instance message to 255 or fewer

In nova/compute/utils.py function exception_to_dict truncates unicode
message to 255. However, in non-English locales, instance message may
be longer than 255 after encoding the unicode message to byte message.
Need to truncate the encoded byte message to 255 or fewer, in order to
ensure db insert operation succeed.

Change-Id: I62fa2830b22e367eb9486d09d3c8818a18ebd20d
Closes-Bug: 1389102
Decrease admin context usage in _get_guest_config

commit 594b18a3 change the context for _get_guest_config
usage to either context given or admin context if it's not
specified. However, it has side effect on later functions
which use the context, so the scope of change the
context should be decreased and this patch fixed that bug.

Change-Id: I7bd96e2c3ee691bae51ac055f57650c14d4e10b4
Replacement `_` on `_LI` in all LOG.info - part 2

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: Iaebb239ef20a0da3df1e3552baf26f412d0fcdc0
Replacement `_` on `_LE` in all LOG.exception

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

Added a hacking rule for the log exception about checking
translation for it.

Change-Id: If80ea6f177bb65afcdffce71550bb38fedcc54eb
Replacement `_` on `_LW` in all LOG.warning part 1

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

Added a hacking rule for the warning about checking
translation for it and checking logging level `warning` instead
alias `warn`.

Change-Id: I2bced49dc5a0408a94d5d20d85b20c682886edbe
Replacement `_` on `_LW` in all LOG.warning part 2

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: I5ab13610d3e10a68ae49f9fd7fac151aa66ea98d
objects: remove VirtPageSize from hardware.py

In part of the objectification of hardward.py, this change
remove VirtPageSize which only handle an integer.

Change-Id: I4a02da4741759623b73d98402bf22d28e9c943d3
Make Instance.save() update numa_topology

This is needed so that we can actually update the given topology with
the updated data after a successful claim.

Deleting it will also be needed when we actually make the resize work
properly for instances with NUMA topology, so we add it here as well.

We do not expose the new InstanceNUMATopology methods as @remotable to
avoid having to bump the object version thus making this an easier
backport target. This is OK since they are only called from
Instance.save() which is @remotable, and can be trivially made remotable
should this be needed later (causing a version bump that need not be
backported).

Change-Id: I64ff2d00ca20bd065bb17ebaa9c40b64b8cbb817
Partial-bug: #1386236
Instances with NUMA will be packed onto hosts

This patch makes the NUMATopologyFilter and instance claims on the
compute host use instance fitting logic to allow for actually packing
instances onto NUMA capable hosts.

This also means that the NUMA placement that is calculated during a
successfull claim will need to be updated in the database to reflect the
host NUMA cell ids the instance cells will be pinned to.

Using fit_instance_to_host() to decide weather an instance can land
on a host makes the NUMATopologyFilter code cleaner as it now fully
re-uses all the logic in VirtNUMAHostTopology and
VirtNUMATopologyCellUsage classes.

Change-Id: Ieabafea73b4d566f4194ca60be38b6415d8a8f3d
Closes-bug: #1386236
Remove VirtNUMAHostTopology.claim_test() method

Previous patches in this series remove the need for this method, so this
patch removes it.

We also remove the can_fit_instances() method which is now part of the
get_fitting_for_instance().

Change-Id: Ieb285bd7e06ea5c5bfc429ccad856272e147f885
Merge "Make Instance.save() update numa_topology"
Merge "Instances with NUMA will be packed onto hosts"
Merge "Remove VirtNUMAHostTopology.claim_test() method"
Merge "objects: remove VirtPageSize from hardware.py"
Merge "Replacement `_` on `_LI` in all LOG.info - part 2"
Merge "Replacement `_` on `_LE` in all LOG.exception"
Merge "Replacement `_` on `_LW` in all LOG.warning part 1"
Merge "Replacement `_` on `_LW` in all LOG.warning part 2"