Tests for PXE bare-metal provisioning helper server.

a part of blueprint general-bare-metal-provisioning-framework.

The deploy helper was landed without tests. This patch reinstates the
tests.

Change-Id: I690ec077e175dc37c2cc5f18170513b0e5bca103
Co-authored-by: Mikyung Kang <mkkang@isi.edu>
Co-authored-by: David Kang <dkang@isi.edu>
Co-authored-by: Ken Igarashi <igarashik@nttdocomo.co.jp>
Co-authored-by: Arata Notsu <notsu@virtualtech.jp>
Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com>
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
Prevent metadata updates until instance is active.

This avoids a race condition where setting metadata too early in the
build process can cause a build failure due to the VM not existing
in Xen.

bug 1100866

Change-Id: I702128799997d91d5f0c0ac189f619bfdf011988
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
Allow snapshots of paused and suspended instances

Fixes bug 1100556

Remove the restriction in the API of snapshotting instances which
are in paused or suspended states and update the libvirt driver
to deal with this accordingly.

Other drivers may need to be updated accordingly.

Change-Id: Iabeb44f843c3c04f767c4103038fcf6c52966ff3
fix misspellings in logs, comments and tests

Flagged with: https://github.com/lyda/misspell-check
Run with: git ls-files | misspellings -f -

Fixes bug: 1100083
Change-Id: Icf1f844fea8ad0a1101d1dc64b9a126608e9536e
Fix nova coverage.

Nova coverage was broken because additional coverage tests were added
that interfere with collecting coverage during unit testing. These new
tests were not properly excluded by the coverage unit test regex. Modify
the regex to exclude any tests of the form '.*test.*coverage.*'. This
allows `tox -ecover` and `run_tests.sh --coverage` to run properly.

Change-Id: Id35f50ec335707c9eadb0e7fb3aa0833661f7333
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
Cleanup of extract_opts.py

Moved global variables to the top.
Removed once used variables
Used option type definitions in OPT_TYPES

Change-Id: Ia0bf39933bac84dbf432e6b4590ceb2527e6889c
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
Replace use of mkdtemp with fixtures.TempDir

Change-Id: I392b2cc14f27a099fecad3e15d3f14b269c1f621
List servers having non-existent flavor should return empty list

When we catch the exception just return an empty list.

Fixes LP# 1102462

Change-Id: I730bd505c40fa76cb0ba687575e3c3882fee6254
Fix for typo in xml API doc sample in nova

Modified:   doc/api_samples/os-flavor-manage/flavor-create-post-req.json
Deleted final comma for proper syntax
Partially fixes: bug 1088528 (part of the bug requires changes in other repo - done)

Change-Id: I5b0b29b4c720a95d5c4c5d957e77dc2e4c9cf8ee
Don't limit SSH keys generation to 1024 bits

Use the default bit length of the underlying ssh-keygen command
(currently 2048) if no bit length is supplied, rather than defaulting to
1024 bits.

bug 1103130

Change-Id: Iba9d378d5bf9e28663e52180ed04c31c16d08aad
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Make compare_result show the difference in lists

If two lists had differed because one had an extra element, both lists
would be included in the exception message. If the lists were large (for
example the list of extensions) it could be very difficult trying to
figure out what is different between the two lists.

This change will show the items that only exist in the expected and/or
result and not the other list.

Change-Id: I6102faea037b4f5e31361adc9db81e79592b7008
Adds conductor support for instance_get_active_by_window_joined

This patch fixes Bug 1102469.

Related to bp/no-db-compute-manager

Change-Id: Ib9e7a4c380eb5d1a0c7059ad6a90d0aec1638fbd