Fix state sync logic related to the PAUSED VM state

A VM may get into the paused state not only because the user request
via API calls, but also due to (temporary) external instrumentations.
Before the virt layer can reliably report the reason, we simply ignore
the state discrepancy. In many cases, the VM state will go back to
running after the external instrumentation is done.

Fix bug 1097806.

Change-Id: I8edef45d60fa79d6ddebf7d0438042a7b3986b55
Ignore auto-generated files by lintstack

Part of blueprint lintstack

Change-Id: I6ca0ec71c7fa083a86920a7ae055ef8e9d19c512
Go back to the original branch after pylint check

Previously we save the current commit hash before running lintstack.
This is no problem for Jenkins but not very friendly if we run
lintstack locally. Every time after it's done, git is in detached
HEAD mode. This patch remembers the current branch name and
automatically go back to the branch if available. Otherwise we fall
back to the commit hash.

Part of blueprint lintstack

Change-Id: I145df3027022fc9a8302bc6da9ab300f677f3386
Refactor: extract method: driver_dict_from_config

Related to blueprint xenapi-volume-drivers

Extract method to create driver registries, so that it could be re-used
in xenapi for a similar purpose.

Change-Id: Ifd25d12335ac96a15dfea4c5ab7f315ff7ddfd8b
Run_as_root to ensure resize2fs succeed for all image backends

Unlike other file based image backend, operation over LVM
logical volumes requires root to functioning correctly. Resize2fs
on logical volumes also need run_as_root.

Otherwise, when running nova-compute as non-root user, instance
creation with flavor disk size larger than image size would fail.
Caused by resize2fs failure.

Fixes LP# 1101137

Change-Id: I16a2aa4382be58843270ff23e11bfb1e20c568d2
Sync latest cfg from oslo-incubator

The main change is:

  c5984ba Move logging config options into the log module

Re-generate nova.conf.sample to reflect the options move.

Change-Id: I3913ea54465658d93dc56e014dfe5d911b0541d6
Use setup.py testr to run testr in run_tests.sh.

Using the setup.py testr command in run_tests.sh will sync run_tests.sh
up with the way tox currently runs the tests and collects coverage.

Change-Id: I21e3965280b3242a860c6be49c4dca44f197b03a
Fix the wrong datatype in task_log table.

    Change period_begining and period_ending to Datetime type.
    Add the migration script.

Change-Id: Ic5d61d6e7e847a1943825a0cb342b0b015bc0b70
Fixes: bug #1102477
Merge "Fix the wrong datatype in task_log table."
Merge "Use setup.py testr to run testr in run_tests.sh."
Merge "Sync latest cfg from oslo-incubator"
Merge "Fix state sync logic related to the PAUSED VM state"
Merge "Refactor: extract method: driver_dict_from_config"
Merge "Run_as_root to ensure resize2fs succeed for all image backends"
Merge "Ignore auto-generated files by lintstack"
Merge "Go back to the original branch after pylint check"