script for configuring a vif in Xen in non-bridged mode

Creates a new vif device without attaching it to a
bridge. Quantum Linux Bridge Agent will attach the
created device to the belonging bridge.

Change-Id: I1818a92a47882d98e384b57e0fa84a0fa09d40ea
Allow pinging own float when using fixed gateway

When pinging your own floating ip, the snat rule is not hit if
dnsmasq is set up to give out an external gateway.

Fixes bug 1096259

Change-Id: Ib71312bf37b3a890567cf6212acabb5821846ab8
Refactor work with TaskLog in sqlalchemy.api

Add _task_log_get_query() private method
It is used to remove from task_log_get() and task_log_get_all() session.
parametr and save performance.

task_log_get() method
Remove session parameter from public method.

task_log_get_all() method
Remove session parameter from public method.

task_log_begin_task()
Remove session parameter from public method.
Remove unused return value.

task_log_end_task()
Remove session parameter from public method.
Use 1 db request instead of 2.
Remove unused return value.

blueprint db-session-cleanup

Change-Id: I2c8252de7978e8fddd800e903f18a73ee9a95034
Upgrade WebOb to 1.2.3

The version of WebOb being used in OpenStack was more than
1 year old. This change updates to the latest stable release.

Upgrading WebOb resolves a version conflict between OpenStack
and Pecan, the web framework used by the Ceilometer team for
version 2 of the ceilometer API.

Refer to http://docs.webob.org/en/latest/news.html
for the list of changes between 1.0.8 and 1.2.3.

bug 1092227

Change-Id: Ib5a005665a5b11198006ce2aa2432399a41fc3d9
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
xenapi: Remove dead code, moves, tests

Related to blueprint xenapi-volume-drivers

Some changes to improve the quality and readability of the existing
code, and to help introducing a clean volume driver concept.

remove:
    dead sm code
move:
    volumeops.introduce_sr -> volume_utils.introduce_sr_unless_present
    volumeops.forget_sr -> volume_utils.forget_sr_if_present
rename:
    volumeops.connect_volume -> _connect_volume
    (to communicate, that it is an internal method)
add tests:
    volumeops.disconnect_volume

Change-Id: Ie5457c3d7823ed77f7ad90252d0c16558e8cfb4f
Fix lintstack check for multi-patch reviews

Some patches in gerrit depend on other patches that are not yet
approved, i.e. not yet landed on master. In this patch lintstack
deals with these cases by currectly generating the right commit
to compare against to further reduce pylint errors.

Part of bp/lintstack

Change-Id: I77622a44949ad2b442d9f2cce6c807e1581830c7
Fix pyflakes issues in integrated tests

Change-Id: I8d483319d0a20a2c8fb7a5e0e22c83048b7399dc
Remove baremetal-compute-pxe.filters

The baremetal PXE driver doesn't seem to run dnsmasq at all, so remove
the rootwrap filter which allows it to do so. This was introduced by
commit a2f260f.

Change-Id: I4cc1127222b73af218a6a8808d0ad54478878af1
Adds a flag to allow configuring a region

If multiple regions contain an endpoint, extract
the correct endpoint URL from the os_region_name parameter
in nova.conf

Fixes LP Bug #1087735

Change-Id: Id4e4f56f336cd2b092a173b3c8e695b173c76f2a
don't clear the database dicts in the tearDown method

This is superfluous as the two dicts (self.engines and
self.test_databases) are re-initialised during setUp anyway and aren't
used in between

Change-Id: Icafa9bdf3b0193f31752e6104ecac0e49476c812
Added sample tests to FlavorSwap API.

Partially implements blueprint nova-api-samples
Fixes bug 1096653

Change-Id: I9a6ca8a023bf0f3404b3a9af635dd29a7a584aa3
Map libvirt error to InstanceNotFound in get_instance_disk_info

When getting instance disk info, the instance may be destroyed/deleted, and a
libvirtError will be raised in XMLDesc method, so catching and mapping it to
InstanceNotFound and the caller can handle it correctly.

Fixes bug #1064581

Change-Id: I07fed3e82e10dad4cb84ae5c8650ada351c24e78
Fix test cases in integrated.test_multiprocess_api

Fixes bug #1098043

Be patient in test_multiprocess_api while waiting service to be spawned or
killed, because:
    * Service spawning has a limit of one process a second.
    * A test server in the cloud might have limited resources,
      the time there might be several times slower.

Change-Id: If75e6dfa5d769985a6c1b46461f25485e2a996ad
Update instance's cell_name in API cell.

It was accidentally being removed before updating the DB due to code
being moved and not updated.  The test for the method was broken, too,
allowing this bug to sneak in.

Fixes bug 1098093

Change-Id: I05c00b8b100568b39afb8ee0ca7ee94d4dd97c0a
Remove bogus 'unplug' calls from libvirt VIF test

Since the 'get_config' method was introduced to the libvirt
VIF class, separate from the 'plug' method, there is no need
to call the 'unplug' method in the test suite

Blueprint: libvirt-vif-driver
Change-Id: I1c3d055e258117c2657cd72386472dff2e0e08b8
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Move libvirt VIF XML config into designer.py

There are a fixed set of sensible XML configurations for
network VIFs. Create some helper methods for configuring
these configurations. Then update the VIF drivers to call
these APIs. The 'designer.py' file will serve as a place
for any policy based XML configuration helpers, as distinct
from config.py which is purely dealing with XML parsing
and formatting

Blueprint: libvirt-vif-driver
Change-Id: I857607c15ed576c65f898df4eb7533505742324b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add some constants to the network model for drivers to use

Following on from

  commit 85f857e62a5edacbf467c19add6e51565ae3669f
  Author: Gary Kotton <gkotton@redhat.com>
  Date:   Sat Dec 8 08:54:16 2012 +0000

    Add vif_type to the VIF model

add some constants to nova.network.model to enumerate the valid
values for 'vif_type'. Also add a constant for max bridge name
length

Blueprint: libvirt-vif-driver
Change-Id: I47949c06fee732681bf0b547577f22a319d4e408
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Make nova network manager fill in vif_type

Make the Nova network manager impl fill in the 'vif_type' parameter
in the VIF configuration for instances. This is hardcoded to
VIF_TYPE_BRIDGE, since that's all Nova network supports.

Blueprint: libvirt-vif-driver
Change-Id: I46d1f0edc820ccc198e5a5c876ea25644ebedd86
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Make Quantum plugin fill in the 'bridge' name

There is a comment in the quantum driver code that says it
ignores the 'bridge' name field. This is misleading, because
the bridge name is still required by any virt drivers when
configuring VIFs so they know how to connect them.

Currently the libvirt Bridge driver invents a bridge name
based on 'qbr' and network['id'], while the OVS drivers
use the libvirt_ovs_bridge config. Move this logic into
the Quantum driver, renaming the config option to
quantum_ovs_bridge. The config option should go away completely
once Quantum can pass across the name, as it does for vif_type

Blueprint: libvirt-vif-driver
Change-Id: Ib043e1e6af5712ae1d1665cdca2e9fdbc89d4351
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add host name to log message for _local_delete

Better log message will hopefully make it easier for operators
to diagnose.

Change-Id: I447f7530a05f9af6e152f1e5d484027684795b27