Add note why E712 is ignored

According to the commit message in
560e5cd84ef2c1a6427c78d35eedc66445e1f77f we ignore E712 because '
With this change we ignore E712 since it is normal to use
"column == True" in sqlalchemy.'

Add note in tox.ini explaining this.

Change-Id: I393e13b1430aae46f958311875678bd99e17b13c
MinDisk size based on the flavor's Disk size

When you create an instance from image  the instance disk size
is expanded to the disk size specified in the flavor.

Normally you cannot use the snapshot  for creating an instance
with smaller disk size (flavor)  because it  potentialy
causes a data corruption.

Every snapshots minDisk size should be inherited from the flavor.

bug 1200279

Change-Id: I1d0e909b78db2c863b4fbb54ad9065207f1a0abe
xenapi: remove propagate xenapi_use_agent key

The compute.api class will already propagate then xenapi_use_agent key
when required, so we can remove the xenapi specific code that tries to
propagate this value. The code did not correctly access the system
metadata, would have failed to propagate the key anyway.

Fixes bug 1204933
Change-Id: Ib291a265318d80705129e565155d4250fd704b75
xenapi: remove pv detection

It was assumed that pygrub is there in domU, so that the RAW and unknown
disks were attached to domU and investigated with pygrub to find out if
PV could be used. This patch removes this functionality. Also some
cleanup is made around the ImageType mess.

From now RAW and unknown disks will not be investigated for PV-ness and
will boot as HVM.

Fixes bug 1196570

Change-Id: If84b93cee36938257b7ad0fa44b3b22878520506
Enforce authenticated connections to libvirt

Authenticated connections for both reads and writes
increases VM security.

The virConnectOpenAuth API is flexible, it effectively
obsoletes virConnectOpen and virConnectOpenReadOnly.
ReadOnly access, with its reduced access to the API,
is obtained by passing in the vir connect flag
VIR_CONNECT_RO (=1)

An added advantage of using openAuth is the fewer API calls
that need to be maintained in the nova libvirt driver.

Removed virConnectOpenReadOnly methods and tests.

Change-Id: I6cb3825d1225807955177d7500899babbb569e20
Adds factory methods to load Hyper-V utils classes

Blueprint: hyper-v-wmi-v2

This patchset provides further decoupling between the ops modules
(e.g. vmops, volumeops) and the utils modules which handle the
interaction with the underlying OS.

The main reason for this refactoring is the need to provide an
implementation of the Hyper-V WMI V2 API (root\virtualization\v2)
that replace the initial version introduced with Hyper-V Server
2008.

Change-Id: I8a2dd8f7dea2e4044525866a0ab26211eb17bf99
Port server_usage API to v3 part 1

This changeset only copies the v2 files into the appropriate v3
directories unchanged. The copy as-is will not be loaded by either
the v2 or v3 extension loaders. The second changeset will then
make the changes required for it to work as a v3 extension.

This is being done in order to make reviewing of extension
porting easier as gerrit will display only what is actually
changed for v3 rather than entirely new files.

Partially implements blueprint nova-v3-api

Change-Id: Ie5cbde7d9a0d77e78c9f9cc577d8cbd36fb74188
Port server_usage API to v3 part 2

Ports the server usage extension and the corresponding
unittests to the v3 API framework

DocImpact

Partially implements blueprint nova-v3-api

Change-Id: Ic5c14ef83e0ec16f36672377f1daa046044dce78
Support setting block size for block devices

cinder now supports backend with different block sizes. Sometimes
we need to set a specific block size or operations against the
backend will result in I/O errors. Additionally its a good idea
to tune the block sizes to the correct size as it can improve I/O
performance.

The basic disk configuration for libvrit now supports setting the
logical and physical block size of devices.  The block size info
is stored in connection_info of the block_device_mapping table
for later use.

By default it does not set the block sizes which defaults to
512 bytes.

DocImpact:
This feature requires libvirt 0.10.2+ and the QEMU or KVM
hypervisor. If a volume has a custom block size, cinder considers
it required. As such the hypervisor and libvirt version are
checked during the attach_volume call. If the hypervisor is not
supported or the libvirt version is too old the attach is
aborted and an exception is raised.

Change-Id: I77adc96b340680218f82bbef8f9ec14711d26a7f
Fixes Bug #1195913
Add expected_errors for extension certificates v3

Partially implements: bp v3-api-extension-versioning

Change-Id: I3610cdbcca4f465e071e54da2965f4016acea9c5
Fix formatting on scheduler documentation

Change-Id: Ifac98bbd9931d9bf75f73d4263aa77867cf52522
Removed scheduler doc costs section

Since commit 820f43fc (Change-Id
Ie3e7611347c334c359dea98d759345b97c66c9c1)
costs are no longer used, so all references to them have been removed.

Change-Id: I6e02bc47643be9f9dfe9d2e42b2335626bf039e7
xenapi: no image upload retry on certain errors

There are a few upload errors that glance plugin should
not retry upload on, as it will fail again. This patch changes
upload to not retry on the following conditions in addition
to the 401 error that it already handles:

- CONFLICT
- REQUEST_ENTITY_TOO_LARGE
- PRECONDITION_FAILED
- FORBIDDEN

Fixes bug 1203726

Change-Id: I538a4f9b133169b2e398e7dfcb3af58fef204f03
Fix instance_usage_audit_log v3 follow REST principles

Use query parameter 'before' instead of show.
BTW, add expected_errors decorator.

Partially implements bp v3-api-extension-versioning

DocImpact

Change-Id: If1168c01e6342675370acdf278e1c0317aff93d8
Switch to Oslo-Incubator's EnvFilter rootwrap

Nova-Network used to have its own class for DnsMasq rootwrap
filtering. This was generalized into a new EnvFilter rootwrap
filter that can specify both commands and environments to pass.

Update to openstack.common.rootwrap to git a117358 of
oslo-incubator's rootwrap. This includes the following commits
merged from oslo:

    3b16d31 Remove DnsmasqFilter and DeprecatedDnsmasqFilter
    f9d1a59 Handle empty arglists in Filters
    233baa2 Handle empty PATH environment variable
    3e74c00 Add IpFilter, IPNetnsExecFilter and EnvFilter
    8b95b1e Handle relative path arguments in Killfilter
    7119e29 Enable hacking H404 test.
    ea78eec Update KillFilter to stop at '\0' for readlink() function.

Related to: blueprint quantum-common-rootwrap

Change-Id: I125e5724259850dc4768fb236cbfa5df199008c0
Raise 404 when instance not found in admin_actions API

The pause/unpause/suspend/resume/reset_network admin action APIs do not
handle the case where the instance in the request is not found and they
raise HTTPUnprocessableEntity (code 422) instead. There are several
other operations in the same API which handle the 404 case and translate
it correctly, this patch cleans up the rest.

Closes-Bug: #1204999

Change-Id: If54d6be99db55b4f99da11fe75c14bf21685e809
remove improper usage of 'assert'

The assert will not raise AssertionError when run Python with '-O' flag.
And at the same time, any program should have a same result with or
without '-O' flag. So we could use assert to check some rare condition,
but we couldn't use it in logic flow or except it must raise an
Assertionerror, for example:

this is not bad:

def func(fname):
    assert os.path.exist(fname)
    f = open(fname)
    ...

but this will have different results with or without '-O' flag

def func(num):
    try:
        assert num is 5
    except: Assertionerror:
        log.error("your number isn't 5!")

The second case is what I fixes in this patch.

fixes bug #1199354
Change-Id: I20e83ecfc181d213f357aa74e0af3a110526904c
Clean up db.sqla.api.instance_* methods

Remove session parameter from public db methods:
instance_get_all_by_filters
instance_metadata_get
instance_metadata_update
instance_system_metadata_get
instance_system_metadata_update

They were never called with session parameter and they
are fully covered by tests so we are able just to remove
session parameter.

Clean up instance_metadata_get and instance_system_metadata_get
Convert rows to dict in one line instead of 4.

blueprint db-session-cleanup

Change-Id: Ib2f50cc4b5a7a2e283d891141a88c7b1ff9f7d43
Clean up session in db.sqla.api.get_ec2 methods

Remove session parameter from public methods

  get_ec2_volume_id_by_uuid
  get_volume_uuid_by_ec2_id
  get_ec2_snapshot_id_by_uuid
  get_snapshot_uuid_by_ec2_id
  get_ec2_instance_id_by_uuid
  get_instance_uuid_by_ec2_id

Because they are never called with session parameter
we could just remove it.

blueprint db-session-cleanup

Change-Id: Iecced3cf144de4f58a1169ed2d8f6940e229bedb
Add expected_errors for extension baremetal v3

Partially implements bp v3-api-extension-versioning

Change-Id: I294aa1cb4e19aba755d8c2c78fd997c7e447204e