Hello community,
here is the log from the commit of package openstack-quantum for openSUSE:Factory checked in at 2013-01-30 11:17:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openstack-quantum (Old)
and /work/SRC/openSUSE:Factory/.openstack-quantum.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openstack-quantum", Maintainer is "radmanic@suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/openstack-quantum/openstack-quantum.changes 2013-01-24 10:46:55.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.openstack-quantum.new/openstack-quantum.changes 2013-01-30 11:17:56.000000000 +0100
@@ -0,0 +1,8 @@
+--------------------------------------------------------------------
+Wed Jan 30 07:10:52 UTC 2013 - cloud-devel@suse.de
+
+- Update to version 2012.2.3+git.1359529852.a84ba7e:
+ + Regression caused by commit b56c2c998
+ + LinuxBridge: update status according to admin_state_up
+ + Ensure that correct root helper is used
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ openstack-quantum.spec ++++++
--- /var/tmp/diff_new_pack.tX0j0R/_old 2013-01-30 11:17:57.000000000 +0100
+++ /var/tmp/diff_new_pack.tX0j0R/_new 2013-01-30 11:17:57.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package openstack-quantum
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -21,8 +21,8 @@
%define username openstack-%{component}
Name: openstack-%{component}
-Version: 2012.2.3+git.1358525076.1a24b68
-Release: 0
+Version: 2012.2.3+git.1359529852.a84ba7e
+Release: 1
License: Apache-2.0
Summary: OpenStack Virtual Network Service (Quantum)
Url: https://launchpad.net/quantum
++++++ quantum-stable-folsom.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quantum-2012.2.3/ChangeLog new/quantum-2012.2.3/ChangeLog
--- old/quantum-2012.2.3/ChangeLog 2013-01-18 00:53:52.000000000 +0100
+++ new/quantum-2012.2.3/ChangeLog 2013-01-30 02:30:05.000000000 +0100
@@ -1,3 +1,50 @@
+commit a84ba7e171e809dbb62e8065f63729ba34d395d8
+Author: Gary Kotton
+Date: Tue Jan 29 15:46:01 2013 +0000
+
+ Regression caused by commit b56c2c998
+
+ Fixes bug 1109001
+
+ Change-Id: I5f0304cca380813e552cd229635a9aacee42126a
+
+ .../linuxbridge/agent/linuxbridge_quantum_agent.py | 7 +++----
+ quantum/plugins/linuxbridge/lb_quantum_plugin.py | 2 +-
+ 2 files changed, 4 insertions(+), 5 deletions(-)
+
+commit b56c2c9983fbbc709d56bb6dfb171045afe56a06
+Author: Gary Kotton
+Date: Sun Jan 13 09:16:29 2013 +0000
+
+ LinuxBridge: update status according to admin_state_up
+
+ Fixes bug 1099065
+
+ In addition to this the agent will only treat ports that exist on the agent.
+
+ Change-Id: I927649a45a860421ef0d825015516000475ad08d
+
+ quantum/agent/rpc.py | 6 +
+ .../linuxbridge/agent/linuxbridge_quantum_agent.py | 162 ++++++++++----------
+ quantum/plugins/linuxbridge/lb_quantum_plugin.py | 25 ++-
+ .../unit/linuxbridge/test_lb_quantum_agent.py | 2 +-
+ quantum/tests/unit/linuxbridge/test_rpcapi.py | 7 +
+ 5 files changed, 116 insertions(+), 86 deletions(-)
+
+commit fe0ae7a7f098a8a65b685bca3bf9ff5be46e54ff
+Author: Gary Kotton
+Date: Fri Jan 25 15:30:26 2013 +0000
+
+ Ensure that correct root helper is used
+
+ Fixes bug 1105193
+
+ Change-Id: Iaaf0b3687c410f5dbfa152d601ae3b2492a610dd
+
+ quantum/agent/ovs_cleanup_util.py | 9 +++++++--
+ quantum/tests/unit/test_agent_ovs_cleanup.py | 1 +
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
commit 1a24b687287393f96b724a6cfc98a796fa3cb2ea
Author: Akihiro MOTOKI
Date: Tue Jan 8 16:57:23 2013 +0900
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quantum-2012.2.3/quantum/agent/ovs_cleanup_util.py new/quantum-2012.2.3/quantum/agent/ovs_cleanup_util.py
--- old/quantum-2012.2.3/quantum/agent/ovs_cleanup_util.py 2013-01-18 00:51:39.000000000 +0100
+++ new/quantum-2012.2.3/quantum/agent/ovs_cleanup_util.py 2013-01-30 02:28:03.000000000 +0100
@@ -42,10 +42,15 @@
'on integration and external network bridges.')
]
+ agent_opts = [
+ cfg.StrOpt('root_helper', default='sudo'),
+ ]
+
conf = cfg.CommonConfigOpts()
conf.register_opts(opts)
conf.register_opts(l3_agent.L3NATAgent.OPTS)
conf.register_opts(interface.OPTS)
+ conf.register_opts(agent_opts, 'AGENT')
config.setup_logging(conf)
return conf
@@ -61,7 +66,7 @@
configuration_bridges = set([conf.ovs_integration_bridge,
conf.external_network_bridge])
- ovs_bridges = set(ovs_lib.get_bridges(conf.root_helper))
+ ovs_bridges = set(ovs_lib.get_bridges(conf.AGENT.root_helper))
if conf.ovs_all_ports:
bridges = ovs_bridges
@@ -70,7 +75,7 @@
for bridge in bridges:
LOG.info(_("Cleaning %s"), bridge)
- ovs = ovs_lib.OVSBridge(bridge, conf.root_helper)
+ ovs = ovs_lib.OVSBridge(bridge, conf.AGENT.root_helper)
ovs.delete_ports(all_ports=conf.ovs_all_ports)
LOG.info(_("OVS cleanup completed successfully"))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quantum-2012.2.3/quantum/agent/rpc.py new/quantum-2012.2.3/quantum/agent/rpc.py
--- old/quantum-2012.2.3/quantum/agent/rpc.py 2013-01-18 00:51:39.000000000 +0100
+++ new/quantum-2012.2.3/quantum/agent/rpc.py 2013-01-30 02:28:03.000000000 +0100
@@ -74,6 +74,12 @@
agent_id=agent_id),
topic=self.topic)
+ def update_device_up(self, context, device, agent_id):
+ return self.call(context,
+ self.make_msg('update_device_up', device=device,
+ agent_id=agent_id),
+ topic=self.topic)
+
def tunnel_sync(self, context, tunnel_ip):
return self.call(context,
self.make_msg('tunnel_sync', tunnel_ip=tunnel_ip),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quantum-2012.2.3/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py new/quantum-2012.2.3/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py
--- old/quantum-2012.2.3/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py 2013-01-18 00:51:39.000000000 +0100
+++ new/quantum-2012.2.3/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py 2013-01-30 02:28:03.000000000 +0100
@@ -62,12 +62,16 @@
PORT_BINDINGS = "port_bindings"
-class LinuxBridge:
+class LinuxBridgeManager:
def __init__(self, interface_mappings, root_helper):
self.interface_mappings = interface_mappings
self.root_helper = root_helper
self.ip = ip_lib.IPWrapper(self.root_helper)
+ self.udev = pyudev.Context()
+ monitor = pyudev.Monitor.from_netlink(self.udev)
+ monitor.filter_by('net')
+
def device_exists(self, device):
"""Check if ethernet device exists."""
try:
@@ -391,38 +395,76 @@
return
LOG.debug("Done deleting subinterface %s" % interface)
+ def update_devices(self, registered_devices):
+ devices = self.udev_get_tap_devices()
+ if devices == registered_devices:
+ return
+ added = devices - registered_devices
+ removed = registered_devices - devices
+ return {'current': devices,
+ 'added': added,
+ 'removed': removed}
+
+ def udev_get_tap_devices(self):
+ devices = set()
+ for device in self.udev.list_devices(subsystem='net'):
+ name = self.udev_get_name(device)
+ if self.is_tap_device(name):
+ devices.add(name)
+ return devices
+
+ def is_tap_device(self, name):
+ return name.startswith(TAP_INTERFACE_PREFIX)
+
+ def udev_get_name(self, device):
+ return device.sys_name
+
class LinuxBridgeRpcCallbacks():
# Set RPC API version to 1.0 by default.
RPC_API_VERSION = '1.0'
- def __init__(self, context, linux_br):
+ def __init__(self, context, agent):
self.context = context
- self.linux_br = linux_br
+ self.agent = agent
def network_delete(self, context, **kwargs):
LOG.debug("network_delete received")
network_id = kwargs.get('network_id')
- bridge_name = self.linux_br.get_bridge_name(network_id)
+ bridge_name = self.agent.br_mgr.get_bridge_name(network_id)
LOG.debug("Delete %s", bridge_name)
- self.linux_br.delete_vlan_bridge(bridge_name)
+ self.agent.br_mgr.delete_vlan_bridge(bridge_name)
def port_update(self, context, **kwargs):
- LOG.debug("port_update received")
+ LOG.debug(_("port_update received"))
+ # Check port exists on node
port = kwargs.get('port')
+ tap_device_name = self.agent.br_mgr.get_tap_device_name(port['id'])
+ devices = self.agent.br_mgr.udev_get_tap_devices()
+ if not tap_device_name in devices:
+ return
+
if port['admin_state_up']:
vlan_id = kwargs.get('vlan_id')
physical_network = kwargs.get('physical_network')
# create the networking for the port
- self.linux_br.add_interface(port['network_id'],
- physical_network,
- vlan_id,
- port['id'])
+ self.agent.br_mgr.add_interface(port['network_id'],
+ physical_network,
+ vlan_id,
+ port['id'])
+ # update plugin about port status
+ self.agent.plugin_rpc.update_device_up(self.context,
+ tap_device_name,
+ self.agent.agent_id)
else:
- bridge_name = self.linux_br.get_bridge_name(port['network_id'])
- tap_device_name = self.linux_br.get_tap_device_name(port['id'])
- self.linux_br.remove_interface(bridge_name, tap_device_name)
+ bridge_name = self.agent.br_mgr.get_bridge_name(
+ port['network_id'])
+ self.agent.br_mgr.remove_interface(bridge_name, tap_device_name)
+ # update plugin about port status
+ self.agent.plugin_rpc.update_device_down(self.context,
+ tap_device_name,
+ self.agent.agent_id)
def create_rpc_dispatcher(self):
'''Get the rpc dispatcher for this manager.
@@ -445,18 +487,18 @@
self.db_connection_url = db_connection_url
def setup_linux_bridge(self, interface_mappings):
- self.linux_br = LinuxBridge(interface_mappings, self.root_helper)
+ self.br_mgr = LinuxBridgeManager(interface_mappings, self.root_helper)
def process_port_binding(self, network_id, interface_id,
physical_network, vlan_id):
- return self.linux_br.add_interface(network_id,
- physical_network, vlan_id,
- interface_id)
+ return self.br_mgr.add_interface(network_id,
+ physical_network, vlan_id,
+ interface_id)
def remove_port_binding(self, network_id, interface_id):
- bridge_name = self.linux_br.get_bridge_name(network_id)
- tap_device_name = self.linux_br.get_tap_device_name(interface_id)
- return self.linux_br.remove_interface(bridge_name, tap_device_name)
+ bridge_name = self.br_mgr.get_bridge_name(network_id)
+ tap_device_name = self.br_mgr.get_tap_device_name(interface_id)
+ return self.br_mgr.remove_interface(bridge_name, tap_device_name)
def process_unplugged_interfaces(self, plugged_interfaces):
"""
@@ -468,44 +510,29 @@
plugged_tap_device_names = []
plugged_gateway_device_names = []
for interface in plugged_interfaces:
- if interface.startswith(GATEWAY_INTERFACE_PREFIX):
- """
- The name for the gateway devices is set by the linux net
- driver, hence we use the name as is
- """
- plugged_gateway_device_names.append(interface)
- else:
- tap_device_name = self.linux_br.get_tap_device_name(interface)
- plugged_tap_device_names.append(tap_device_name)
+ tap_device_name = self.br_mgr.get_tap_device_name(interface)
+ plugged_tap_device_names.append(tap_device_name)
LOG.debug("plugged tap device names %s" % plugged_tap_device_names)
- for tap_device in self.linux_br.get_all_tap_devices():
+ for tap_device in self.br_mgr.get_all_tap_devices():
if tap_device not in plugged_tap_device_names:
current_bridge_name = (
- self.linux_br.get_bridge_for_tap_device(tap_device))
+ self.br_mgr.get_bridge_for_tap_device(tap_device))
if current_bridge_name:
- self.linux_br.remove_interface(current_bridge_name,
- tap_device)
-
- for gw_device in self.linux_br.get_all_gateway_devices():
- if gw_device not in plugged_gateway_device_names:
- current_bridge_name = (
- self.linux_br.get_bridge_for_tap_device(gw_device))
- if current_bridge_name:
- self.linux_br.remove_interface(current_bridge_name,
- gw_device)
+ self.br_mgr.remove_interface(current_bridge_name,
+ tap_device)
def process_deleted_networks(self, vlan_bindings):
current_quantum_networks = vlan_bindings.keys()
current_quantum_bridge_names = []
for network in current_quantum_networks:
- bridge_name = self.linux_br.get_bridge_name(network)
+ bridge_name = self.br_mgr.get_bridge_name(network)
current_quantum_bridge_names.append(bridge_name)
- quantum_bridges_on_this_host = self.linux_br.get_all_quantum_bridges()
+ quantum_bridges_on_this_host = self.br_mgr.get_all_quantum_bridges()
for bridge in quantum_bridges_on_this_host:
if bridge not in current_quantum_bridge_names:
- self.linux_br.delete_vlan_bridge(bridge)
+ self.br_mgr.delete_vlan_bridge(bridge)
def manage_networks_on_host(self, db,
old_vlan_bindings,
@@ -637,8 +664,7 @@
self.context = context.RequestContext('quantum', 'quantum',
is_admin=False)
# Handle updates from service
- self.callbacks = LinuxBridgeRpcCallbacks(self.context,
- self.linux_br)
+ self.callbacks = LinuxBridgeRpcCallbacks(self.context, self)
self.dispatcher = self.callbacks.create_rpc_dispatcher()
# Define the listening consumers for the agent
consumers = [[topics.PORT, topics.UPDATE],
@@ -646,41 +672,14 @@
self.connection = agent_rpc.create_consumers(self.dispatcher,
self.topic,
consumers)
- self.udev = pyudev.Context()
- monitor = pyudev.Monitor.from_netlink(self.udev)
- monitor.filter_by('net')
def setup_linux_bridge(self, interface_mappings):
- self.linux_br = LinuxBridge(interface_mappings, self.root_helper)
+ self.br_mgr = LinuxBridgeManager(interface_mappings, self.root_helper)
def remove_port_binding(self, network_id, interface_id):
- bridge_name = self.linux_br.get_bridge_name(network_id)
- tap_device_name = self.linux_br.get_tap_device_name(interface_id)
- return self.linux_br.remove_interface(bridge_name, tap_device_name)
-
- def update_devices(self, registered_devices):
- devices = self.udev_get_all_tap_devices()
- if devices == registered_devices:
- return
- added = devices - registered_devices
- removed = registered_devices - devices
- return {'current': devices,
- 'added': added,
- 'removed': removed}
-
- def udev_get_all_tap_devices(self):
- devices = set()
- for device in self.udev.list_devices(subsystem='net'):
- name = self.udev_get_name(device)
- if self.is_tap_device(name):
- devices.add(name)
- return devices
-
- def is_tap_device(self, name):
- return name.startswith(TAP_INTERFACE_PREFIX)
-
- def udev_get_name(self, device):
- return device.sys_name
+ bridge_name = self.br_mgr.get_bridge_name(network_id)
+ tap_device_name = self.br_mgr.get_tap_device_name(interface_id)
+ return self.br_mgr.remove_interface(bridge_name, tap_device_name)
def process_network_devices(self, device_info):
resync_a = False
@@ -708,10 +707,10 @@
LOG.info("Port %s updated. Details: %s", device, details)
if details['admin_state_up']:
# create the networking for the port
- self.linux_br.add_interface(details['network_id'],
- details['physical_network'],
- details['vlan_id'],
- details['port_id'])
+ self.br_mgr.add_interface(details['network_id'],
+ details['physical_network'],
+ details['vlan_id'],
+ details['port_id'])
else:
self.remove_port_binding(details['network_id'],
details['port_id'])
@@ -750,7 +749,7 @@
devices.clear()
sync = False
- device_info = self.update_devices(devices)
+ device_info = self.br_mgr.update_devices(devices)
# notify plugin about device deltas
if device_info:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quantum-2012.2.3/quantum/plugins/linuxbridge/lb_quantum_plugin.py new/quantum-2012.2.3/quantum/plugins/linuxbridge/lb_quantum_plugin.py
--- old/quantum-2012.2.3/quantum/plugins/linuxbridge/lb_quantum_plugin.py 2013-01-18 00:51:39.000000000 +0100
+++ new/quantum-2012.2.3/quantum/plugins/linuxbridge/lb_quantum_plugin.py 2013-01-30 02:28:03.000000000 +0100
@@ -72,8 +72,10 @@
'network_id': port['network_id'],
'port_id': port['id'],
'admin_state_up': port['admin_state_up']}
- # Set the port status to UP
- db.set_port_status(port['id'], q_const.PORT_STATUS_ACTIVE)
+ new_status = (q_const.PORT_STATUS_ACTIVE if port['admin_state_up']
+ else q_const.PORT_STATUS_DOWN)
+ if port['status'] != new_status:
+ db.set_port_status(port['id'], new_status)
else:
entry = {'device': device}
LOG.debug("%s can not be found in database", device)
@@ -89,14 +91,29 @@
if port:
entry = {'device': device,
'exists': True}
- # Set port status to DOWN
- db.set_port_status(port['id'], q_const.PORT_STATUS_DOWN)
+ if port['status'] != q_const.PORT_STATUS_DOWN:
+ # Set port status to DOWN
+ db.set_port_status(port['id'], q_const.PORT_STATUS_DOWN)
else:
entry = {'device': device,
'exists': False}
LOG.debug("%s can not be found in database", device)
return entry
+ def update_device_up(self, rpc_context, **kwargs):
+ """Device is up on agent"""
+ agent_id = kwargs.get('agent_id')
+ device = kwargs.get('device')
+ LOG.debug(_("Device %(device)s up %(agent_id)s"),
+ locals())
+ port = db.get_port_from_device(device[self.TAP_PREFIX_LEN:])
+ if port:
+ if port['status'] != q_const.PORT_STATUS_ACTIVE:
+ # Set port status to ACTIVE
+ db.set_port_status(port['id'], q_const.PORT_STATUS_ACTIVE)
+ else:
+ LOG.debug(_("%s can not be found in database"), device)
+
class AgentNotifierApi(proxy.RpcProxy):
'''Agent side of the linux bridge rpc API.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quantum-2012.2.3/quantum/tests/unit/linuxbridge/test_lb_quantum_agent.py new/quantum-2012.2.3/quantum/tests/unit/linuxbridge/test_lb_quantum_agent.py
--- old/quantum-2012.2.3/quantum/tests/unit/linuxbridge/test_lb_quantum_agent.py 2013-01-18 00:51:39.000000000 +0100
+++ new/quantum-2012.2.3/quantum/tests/unit/linuxbridge/test_lb_quantum_agent.py 2013-01-30 02:28:03.000000000 +0100
@@ -30,7 +30,7 @@
interface_mappings = {'physnet1': 'eth1'}
root_helper = cfg.CONF.AGENT.root_helper
- self.linux_bridge = linuxbridge_quantum_agent.LinuxBridge(
+ self.linux_bridge = linuxbridge_quantum_agent.LinuxBridgeManager(
interface_mappings, root_helper)
def test_ensure_physical_in_bridge_invalid(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quantum-2012.2.3/quantum/tests/unit/linuxbridge/test_rpcapi.py new/quantum-2012.2.3/quantum/tests/unit/linuxbridge/test_rpcapi.py
--- old/quantum-2012.2.3/quantum/tests/unit/linuxbridge/test_rpcapi.py 2013-01-18 00:51:34.000000000 +0100
+++ new/quantum-2012.2.3/quantum/tests/unit/linuxbridge/test_rpcapi.py 2013-01-30 02:27:58.000000000 +0100
@@ -91,3 +91,10 @@
'update_device_down', rpc_method='call',
device='fake_device',
agent_id='fake_agent_id')
+
+ def test_update_device_up(self):
+ rpcapi = agent_rpc.PluginApi(topics.PLUGIN)
+ self._test_lb_api(rpcapi, topics.PLUGIN,
+ 'update_device_up', rpc_method='call',
+ device='fake_device',
+ agent_id='fake_agent_id')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quantum-2012.2.3/quantum/tests/unit/test_agent_ovs_cleanup.py new/quantum-2012.2.3/quantum/tests/unit/test_agent_ovs_cleanup.py
--- old/quantum-2012.2.3/quantum/tests/unit/test_agent_ovs_cleanup.py 2013-01-18 00:51:39.000000000 +0100
+++ new/quantum-2012.2.3/quantum/tests/unit/test_agent_ovs_cleanup.py 2013-01-30 02:28:03.000000000 +0100
@@ -29,6 +29,7 @@
self.assertEqual(conf.external_network_bridge, 'br-ex')
self.assertEqual(conf.ovs_integration_bridge, 'br-int')
self.assertFalse(conf.ovs_all_ports)
+ self.assertEqual(conf.AGENT.root_helper, 'sudo')
def test_main(self):
with mock.patch('quantum.common.config.setup_logging'):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quantum-2012.2.3/quantum/vcsversion.py new/quantum-2012.2.3/quantum/vcsversion.py
--- old/quantum-2012.2.3/quantum/vcsversion.py 2013-01-18 00:53:51.000000000 +0100
+++ new/quantum-2012.2.3/quantum/vcsversion.py 2013-01-30 02:30:04.000000000 +0100
@@ -2,6 +2,6 @@
# This file is automatically generated by setup.py, So don't edit it. :)
version_info = {
'branch_nick': '(no',
- 'revision_id': '1a24b687287393f96b724a6cfc98a796fa3cb2ea',
- 'revno': 1371
+ 'revision_id': 'a84ba7e171e809dbb62e8065f63729ba34d395d8',
+ 'revno': 1374
}
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org