Hello community,

here is the log from the commit of package openstack-quantum for 
openSUSE:Factory checked in at 2013-06-20 21:26:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openstack-quantum (Old)
 and      /work/SRC/openSUSE:Factory/.openstack-quantum.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "openstack-quantum"

Changes:
--------
--- /work/SRC/openSUSE:Factory/openstack-quantum/openstack-quantum.changes      
2013-04-24 16:06:45.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.openstack-quantum.new/openstack-quantum.changes 
2013-06-20 21:26:21.000000000 +0200
@@ -1,0 +2,192 @@
+Wed Jun 19 14:04:31 UTC 2013 - [email protected]
+
+- Backport fix for adding 0/0 to dhcp-agent netns to allow dnsmasq
+  process to perform dns lookups. Fix for master branch is here:
+  https://review.openstack.org/#/c/31533/9. Patch name:
+  quantum-add-default-route-in-netns-dhcp-agent.patch
+
+-------------------------------------------------------------------
+Mon Jun 17 16:20:15 UTC 2013 - [email protected]
+
+- Do not make /etc/quantum/quantum.conf world-readable: it contains
+  passwords.
+
+-------------------------------------------------------------------
+Mon Jun 17 11:41:30 UTC 2013 - [email protected]
+
+- Only require python-discover on SLE since it's backporting features
+  to Python-2.6
+
+--------------------------------------------------------------------
+Mon Jun 17 05:36:23 UTC 2013 - [email protected]
+
+- Update to version 2013.1.3.a15.g9b38a4b:
+  + Do not import anything from quantum into rootwrap (bnc#824702)
+- remove do-not-import-crap-in-rootwrap.diff
+
+--------------------------------------------------------------------
+Thu Jun 13 23:58:25 UTC 2013 - [email protected]
+
+- Update to version 2013.1.3.a13.g1458438:
+  + Handle portinfo msg after port deletion in NEC plugin
+  + Ensure to remove auto delete ports from OFC in NEC plugin
+
+-------------------------------------------------------------------
+Thu Jun 13 16:47:18 UTC 2013 - [email protected]
+
+- add do-not-import-crap-in-rootwrap.diff (bnc#824702) 
+
+--------------------------------------------------------------------
+Wed Jun 12 23:59:26 UTC 2013 - [email protected]
+
+- Update to version 2013.1.3.a10.gd298464:
+  + Enable router extension in Brocade Plugin
+  + NEC plugin: Ensure to delete portinfo when port_removed RPC.
+  + Expose most common QueuePoll parameters from SQLAlchemy
+  + DbQuotaDriver allows negative quotas to be set.
+
+-------------------------------------------------------------------
+Wed Jun 12 17:05:44 UTC 2013 - [email protected]
+
+- add dnsmasq depency for dhcp-agent
+
+--------------------------------------------------------------------
+Tue Jun 11 10:02:55 UTC 2013 - [email protected]
+
+- Update to version 2013.1.3.a2.g1fb9952:
+  + Port profile should not mark vlan as native-vlan
+
+--------------------------------------------------------------------
+Fri Jun  7 23:59:28 UTC 2013 - [email protected]
+
+- Update to version 2013.1.3.a1.ge1d25de:
+  + Bump stable/grizzly next version to 2013.1.3
+
+-------------------------------------------------------------------
+Wed Jun  5 13:58:39 UTC 2013 - [email protected]
+
+- fix home directory for openstack-quantum user
+
+-------------------------------------------------------------------
+Sat Jun  1 08:28:31 UTC 2013 - [email protected]
+
+- remove 0001-Use-exec_dirs-for-rootwrap-commands.patch 
+- remove 0002-restore-extra-filters.diff 
+
+--------------------------------------------------------------------
+Fri May 31 09:17:49 UTC 2013 - [email protected]
+
+- Update to version 2013.1.2.a46.g4bac39b:
+  + Add l3 attribute to network
+  + Add support for dnsmasq version 2.48
+  + Add _usr variants for iptables rootwraps
+
+-------------------------------------------------------------------
+Thu May 30 15:21:01 UTC 2013 - [email protected]
+
+- remove quantum-bug-1170793-dnsmasq-2.48-fix.diff 
+- remove iptables-firewall.filters.patch
+
+-------------------------------------------------------------------
+Wed May 29 10:33:59 UTC 2013 - [email protected]
+
+- fix runtime/test requires 
+- drop ignore-kombu-version.diff
+- remove setBadness call from rpmlintrc
+
+--------------------------------------------------------------------
+Fri May 24 23:43:38 UTC 2013 - [email protected]
+
+- Update to version 2013.1.2.a40.g9f9ae95:
+  + Enable quantum-netns-cleanup to receive force as cli parameter
+
+--------------------------------------------------------------------
+Wed May 22 11:08:50 UTC 2013 - [email protected]
+
+- Import fix for older dnsmasq versions from
+  https://review.openstack.org/#/c/29630/
+- Update to version 2013.1.2.a38.g015f4b6:
+  + relax amqplib and kombu version requirements
+  + update-port error if port does not exist in nvp
+  + get_security_groups now creates default security group
+  + Log a warning if dnsmasq version is below the minimum required
+
+--------------------------------------------------------------------
+Sun May 19 23:44:12 UTC 2013 - [email protected]
+
+- Update to version 2013.1.2.a30.gfd149ce:
+  + Allow admin to delete default security groups
+
+--------------------------------------------------------------------
+Thu May 16 00:02:31 UTC 2013 - [email protected]
+
+- Update to version 2013.1.2.a28.g0b6a465:
+  + make default transport type configurable nvp
+  + Correct NVP plugin path for folsom to grizzly migration
+
+--------------------------------------------------------------------
+Wed May 15 09:12:58 UTC 2013 - [email protected]
+
+- Update to version 2013.1.2.a24.gd177e58:
+  + Fix 500 raised on disassociate_floatingips when out of sync
+  + Validate that netaddr does not receive a string with whitespace
+  + Change Daemon class to better match process command lines.
+  + Fetch routers ports for metadata access from DB
+  + Don't run metadata proxy when it is not needed
+
+--------------------------------------------------------------------
+Sun May 12 23:55:46 UTC 2013 - [email protected]
+
+- Update to version 2013.1.2.a15.g0f51668:
+  + Do not attempt to kill already-dead dnsmasq
+  + OSLO updates for stable
+  + Treat unbound port
+  + Duplicate line in Brocade plugin
+  + Create veth peer in namespace.
+  + in dhcp_agent, always use quantum.conf root_helper
+  + Add kill-metadata rootwrap filter to support RHEL.
+
+--------------------------------------------------------------------
+Fri May 10 23:57:18 UTC 2013 - [email protected]
+
+- Update to version 2013.1.2.a1.ga2e24d0:
+  + Bump stable/grizzly next version to 2013.1.2
+
+--------------------------------------------------------------------
+Mon May  6 23:58:05 UTC 2013 - [email protected]
+
+- Update to version 2013.1.1.a28.g0602bac:
+  + Adds POST method support in the metadata service
+
+--------------------------------------------------------------------
+Fri May  3 08:33:45 UTC 2013 - [email protected]
+
+- Update to version 2013.1.1.a27.g1385a81:
+  + Add RabbitMQ and QPID HA support flags to quantum.conf
+  + Fix port_id filter not honored
+
+-------------------------------------------------------------------
+Thu May  2 10:12:59 UTC 2013 - [email protected]
+
+- add DnsmasqSles class for support of older dnsmasq version present on 
+  SLES11 (Patch: quantum-add-sles-dnsmasq-support.diff)
+
+--------------------------------------------------------------------
+Fri Apr 26 09:57:40 UTC 2013 - [email protected]
+
+- Update to version 2013.1.1.a24.g92c234b:
+  + Make "shared" filter more compatible with diff DBs
+  + Add missing security group quota settings to quantum.conf
+  + Improve the deprecated message about DEFAULT.root_helper
+
+-------------------------------------------------------------------
+Tue Apr 23 21:35:16 UTC 2013 - [email protected]
+
+- remove quantum from the summary
+
+-------------------------------------------------------------------
+Tue Apr 23 15:11:25 UTC 2013 - [email protected]
+
+- set external_network_bridge in l3_agent to "" (defaults for linuxbridge)
+
+-------------------------------------------------------------------

Old:
----
  0001-Use-exec_dirs-for-rootwrap-commands.patch
  0002-restore-extra-filters.diff
  ignore-kombu-version.diff
  iptables-firewall.filters.patch

New:
----
  quantum-add-default-route-in-netns-dhcp-agent.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ openstack-quantum-doc.spec ++++++
--- /var/tmp/diff_new_pack.0svqNu/_old  2013-06-20 21:26:22.000000000 +0200
+++ /var/tmp/diff_new_pack.0svqNu/_new  2013-06-20 21:26:22.000000000 +0200
@@ -19,7 +19,7 @@
 %define component quantum
 
 Name:           openstack-%{component}-doc
-Version:        2013.1
+Version:        2013.1.3.a15.g9b38a4b
 Release:        0
 Summary:        OpenStack Virtual Network Service (Quantum) - Documentation
 License:        Apache-2.0
@@ -59,7 +59,7 @@
 This package contains documentation files for openstack-quantum.
 
 %prep
-%setup -q -n quantum-2013.1
+%setup -q -n quantum-2013.1.3.a15.g9b38a4b
 %openstack_cleanup_prep
 
 %build

++++++ openstack-quantum.spec ++++++
--- /var/tmp/diff_new_pack.0svqNu/_old  2013-06-20 21:26:22.000000000 +0200
+++ /var/tmp/diff_new_pack.0svqNu/_new  2013-06-20 21:26:22.000000000 +0200
@@ -21,9 +21,9 @@
 %define username openstack-%{component}
 
 Name:           openstack-%{component}
-Version:        2013.1
+Version:        2013.1.3.a15.g9b38a4b
 Release:        0
-Summary:        OpenStack Virtual Network Service (Quantum)
+Summary:        OpenStack Network
 License:        Apache-2.0
 Group:          System/Management
 Url:            https://launchpad.net/quantum
@@ -33,14 +33,10 @@
 Source3:        quantum-sudoers
 Source4:        openstack-%{component}-plugin.init
 Source5:        sysconfig.quantum
-# PATCH-FIX-OPENSUSE: [email protected] -- Our testing state path is 
"/var/lib/openstack-quantum-test", not %python_sitelib
+# PATCH-FIX-OPENSUSE: [email protected] -- Our testing state path is 
"/var/lib/openstack-quantum-test", not %%python_sitelib
 Patch0:         quantum-test-default-state-path.patch
-# PATCH-FIX-OPENSUSE: [email protected] - also accept newer kombu versions
-Patch1:         ignore-kombu-version.diff
 Patch2:         quantum-suse-config-defaults.diff
-Patch5:         0001-Use-exec_dirs-for-rootwrap-commands.patch
-Patch6:         0002-restore-extra-filters.diff
-Patch99:        iptables-firewall.filters.patch
+Patch3:         quantum-add-default-route-in-netns-dhcp-agent.patch
 BuildRequires:  fdupes
 BuildRequires:  openstack-suse-macros
 BuildRequires:  openstack-suse-sudo
@@ -52,7 +48,7 @@
 Requires:       logrotate
 Requires:       openstack-suse-sudo
 Requires:       python >= 2.6.8
-Requires:       python-oslo.config
+Requires:       python-oslo.config >= 1.1.0
 Requires:       python-quantum = %{version}
 %if 0%{?suse_version} > 1110
 Requires(pre):  pwdutils
@@ -82,37 +78,36 @@
 capabilities (e.g., QoS, ACLs, network monitoring, etc)
 
 %package -n python-quantum
-
-Summary:        OpenStack Virtual Network Service (Quantum) - Python module
+Summary:        OpenStack Network - Python module
 Group:          Development/Languages/Python
 Requires:       python >= 2.6.8
 Requires:       python-Paste
-Requires:       python-PasteDeploy
+Requires:       python-PasteDeploy >= 1.5.0
 Requires:       python-Routes >= 1.12.3
-Requires:       python-SQLAlchemy
-Requires:       python-WebOb >= 1.0.8
-Requires:       python-alembic
+Requires:       python-SQLAlchemy >= 0.7.8
+Requires:       python-WebOb >= 1.2
+Requires:       python-alembic >= 0.4.1
 Requires:       python-alembic >= 0.4.1
 Requires:       python-amqplib >= 0.6.1
-Requires:       python-anyjson
+Requires:       python-anyjson >= 0.2.4
 Requires:       python-argparse
 Requires:       python-eventlet >= 0.9.17
 Requires:       python-extras
-Requires:       python-greenlet
+Requires:       python-greenlet >= 0.3.1
 Requires:       python-httplib2
 Requires:       python-iso8601 >= 0.1.4
 Requires:       python-keystoneclient >= 0.2.0
-Requires:       python-kombu >= 2.0.0
+Requires:       python-kombu >= 1.0.4
 Requires:       python-netaddr
 Requires:       python-novaclient
 Requires:       python-pyudev
-Requires:       python-quantumclient
+Requires:       python-quantumclient >= 2.2.0
 
 %description -n python-quantum
 This package contains the core Python module of OpenStack Quantum.
 
 %package server
-Summary:        OpenStack Virtual Network Service (Quantum) - Python module
+Summary:        OpenStack Network - Python module
 Group:          Development/Languages/Python
 PreReq:         %name = %version
 Requires:       python >= 2.6.8
@@ -121,16 +116,17 @@
 This package provides the Quantum server
 
 %package dhcp-agent
-Summary:        OpenStack Virtual Network Service (Quantum) - DHCP Agent
+Summary:        OpenStack Network - DHCP Agent
 Group:          Development/Languages/Python
 PreReq:         %name = %version
+Requires:       dnsmasq
 Requires:       python >= 2.6.8
 
 %description dhcp-agent
 This package provides the DHCP Agent.
 
 %package l3-agent
-Summary:        OpenStack Virtual Network Service (Quantum) - L3 Agent
+Summary:        OpenStack Network - L3 Agent
 Group:          Development/Languages/Python
 PreReq:         %name = %version
 Requires:       python >= 2.6.8
@@ -139,7 +135,7 @@
 This package provides the L3 Agent.
 
 %package lbaas-agent
-Summary:        OpenStack Virtual Network Service (Quantum) - Load Balancing 
Agent
+Summary:        OpenStack Network - Load Balancing Agent
 Group:          Development/Languages/Python
 PreReq:         %name = %version
 Requires:       python >= 2.6.8
@@ -149,7 +145,7 @@
 
 
 %package linuxbridge-agent
-Summary:        OpenStack Virtual Network Service (Quantum) - Linux Bridge 
Agent
+Summary:        OpenStack Network - Linux Bridge Agent
 Group:          Development/Languages/Python
 Provides:       openstack-quantum-agent = %version
 PreReq:         %name = %version
@@ -159,7 +155,7 @@
 This package provides the Linu xBridge Agent.
 
 %package metadata-agent
-Summary:        OpenStack Virtual Network Service (Quantum) - Meta Data Agent
+Summary:        OpenStack Network - Meta Data Agent
 Group:          Development/Languages/Python
 PreReq:         %name = %version
 Requires:       python >= 2.6.8
@@ -168,7 +164,7 @@
 This package provides the Meta Data Agent.
 
 %package nec-agent
-Summary:        OpenStack Virtual Network Service (Quantum) - NEC Agent
+Summary:        OpenStack Network - NEC Agent
 Group:          Development/Languages/Python
 PreReq:         %name = %version
 Provides:       openstack-quantum-agent = %version
@@ -178,7 +174,7 @@
 This package provides the NEC Agent.
 
 %package ryu-agent
-Summary:        OpenStack Virtual Network Service (Quantum) - ryu Agent
+Summary:        OpenStack Network - ryu Agent
 Group:          Development/Languages/Python
 Provides:       openstack-quantum-agent = %version
 PreReq:         %name = %version
@@ -188,7 +184,7 @@
 This package provides the ryu Agent.
 
 %package openvswitch-agent
-Summary:        OpenStack Virtual Network Service (Quantum) - Open vSwitch
+Summary:        OpenStack Network - Open vSwitch
 Group:          Development/Languages/Python
 Provides:       openstack-quantum-agent = %version
 PreReq:         %name = %version
@@ -200,22 +196,29 @@
 
 
 %package test
-
-Summary:        OpenStack Virtual Network Service (Quantum) - Testsuite
+Summary:        OpenStack Network - Testsuite
 Group:          Development/Languages/Python
 Requires:       %{name} = %{version}
-Requires:       python-WebTest
+Requires:       python-WebTest >= 1.3.3
 Requires:       python-cliff >= 1.3.1
 Requires:       python-configobj
 Requires:       python-coverage
+%if 0%{?suse_version} && 0%{?suse_version} <= 1110
+Requires:       python-discover
+%endif
+Requires:       python-fixtures >= 0.3.12
 Requires:       python-mock >= 1.0b1
-Requires:       python-mox
+Requires:       python-mox >= 0.5.3
+Requires:       python-netifaces
 Requires:       python-nose
 Requires:       python-nosehtmloutput
 Requires:       python-nosexcover
 Requires:       python-openstack.nose_plugin
-Requires:       python-pep8
-Requires:       python-routes
+Requires:       python-pep8 >= 1.3.3
+Requires:       python-python-subunit
+Requires:       python-routes >= 1.12.3
+Requires:       python-testrepository >= 0.0.13
+Requires:       python-testtools >= 0.9.27
 Requires:       python-unittest2
 
 %description test
@@ -223,15 +226,11 @@
 of OpenStack Quantum.
 
 %prep
-%setup -q -n quantum-2013.1
+%setup -q -n quantum-2013.1.3.a15.g9b38a4b
 %openstack_cleanup_prep
 %patch0
-%patch1
-%patch2 -p2
-
-#patch5 -p1
-#patch6
-%patch99 -p1
+%patch2
+%patch3 -p1
 
 %build
 python setup.py build
@@ -294,6 +293,7 @@
 openstack-config --set %{buildroot}/etc/quantum/quantum.conf DEFAULT 
core_plugin quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2
 openstack-config --set %{buildroot}/etc/quantum/quantum.conf DEFAULT 
root_helper "sudo quantum-rootwrap /etc/quantum/rootwrap.conf"
 openstack-config --set %{buildroot}/etc/quantum/quantum.conf DEFAULT log_dir 
/var/log/quantum
+openstack-config --set %{buildroot}/etc/quantum/l3_agent.ini DEFAULT 
external_network_bridge ""
 
 ### test subpackage
 %openstack_test_package_install
@@ -324,7 +324,7 @@
 
 %pre
 getent group %{groupname} > /dev/null || groupadd -r %{groupname}
-getent passwd %{username} > /dev/null || useradd -r -g %{groupname} -d 
%{_localstatedir}/lib/nova -s /sbin/nologin -c "Openstack Quantum Daemons" 
%{username}
+getent passwd %{username} > /dev/null || useradd -r -g %{groupname} -d 
%{_localstatedir}/lib/quantum -s /sbin/nologin -c "Openstack Quantum Daemons" 
%{username}
 exit 0
 
 %post server
@@ -348,7 +348,7 @@
 %dir %{_sysconfdir}/quantum
 %config(noreplace) %{_sysconfdir}/quantum/api-paste.ini
 %config %{_sysconfdir}/quantum/policy.json
-%config(noreplace) %{_sysconfdir}/quantum/quantum.conf
+%config(noreplace) %attr(0640, root, %{groupname}) 
%{_sysconfdir}/quantum/quantum.conf
 %config %{_sysconfdir}/quantum/rootwrap.conf
 %dir %{_sysconfdir}/quantum/rootwrap.d/
 %ghost %dir %attr(0755, %{username}, root) %{_localstatedir}/run/quantum

++++++ quantum-add-default-route-in-netns-dhcp-agent.patch ++++++
From: Carl Baldwin <[email protected]>
Date: Fri, 31 May 2013 20:44:14 +0000 (+0000)
Subject: Adds default route to DHCP namespace for upstream name resolution.
X-Git-Url: 
https://review.openstack.org/gitweb?p=openstack%2Fquantum.git;a=commitdiff_plain;h=3a0e536b3f737d6c32f22751d477405d7239363f

Adds default route to DHCP namespace for upstream name resolution.

Any time the DHCP server is updated this code will maintain a default
route in the DHCP namespace using the gateway_ip attribute of the
first DHCP-enabled IPV4 subnet in the list of subnets where gateway_ip
is not None.  This strategy uses the same gateway ip that the DHCP
server hands to the VMs on the network.

Change-Id: I0807550a848e1b610c7775d215643ad9c83629ed
Fixes: Bug #1181378
---

Index: quantum-2013.1.3.a15.g9b38a4b/quantum/agent/dhcp_agent.py
===================================================================
--- quantum-2013.1.3.a15.g9b38a4b.orig/quantum/agent/dhcp_agent.py
+++ quantum-2013.1.3.a15.g9b38a4b/quantum/agent/dhcp_agent.py
@@ -529,6 +529,54 @@ class DeviceManager(object):
         host_uuid = uuid.uuid5(uuid.NAMESPACE_DNS, socket.gethostname())
         return 'dhcp%s-%s' % (host_uuid, network.id)
 
+    def _get_device(self, network):
+        """Return DHCP ip_lib device for this host on the network."""
+        device_id = self.get_device_id(network)
+        port = self.plugin.get_dhcp_port(network.id, device_id)
+        interface_name = self.get_interface_name(network, port)
+        namespace = NS_PREFIX + network.id
+        return ip_lib.IPDevice(interface_name,
+                               self.root_helper,
+                               namespace)
+
+    def _set_default_route(self, network):
+        """Sets the default gateway for this dhcp namespace.
+
+        This method is idempotent and will only adjust the route if adjusting
+        it would change it from what it already is.  This makes it safe to call
+        and avoids unnecessary perturbation of the system.
+        """
+        if not self.conf.use_namespaces:
+            return
+
+        device = self._get_device(network)
+        gateway = device.route.get_gateway()
+
+        for subnet in network.subnets:
+            skip_subnet = (
+                subnet.ip_version != 4
+                or not subnet.enable_dhcp
+                or subnet.gateway_ip is None)
+
+            if skip_subnet:
+                continue
+
+            if gateway != subnet.gateway_ip:
+                m = _('Setting gateway for dhcp netns on net %(n)s to %(ip)s')
+                LOG.debug(m, {'n': network.id, 'ip': subnet.gateway_ip})
+
+                device.route.add_gateway(subnet.gateway_ip)
+
+            return
+
+        # No subnets on the network have a valid gateway.  Clean it up to avoid
+        # confusion from seeing an invalid gateway here.
+        if gateway is not None:
+            msg = _('Removing gateway for dhcp netns on net %s')
+            LOG.debug(msg, network.id)
+
+            device.route.delete_gateway(gateway)
+
     def setup(self, network, reuse_existing=False):
         """Create and initialize a device for network's DHCP on this host."""
         device_id = self.get_device_id(network)
@@ -587,9 +635,16 @@ class DeviceManager(object):
                 # Only 1 subnet on metadata access network
                 gateway_ip = metadata_subnets[0].gateway_ip
                 device.route.add_gateway(gateway_ip)
+        else:
+            self._set_default_route(network)
 
         return interface_name
 
+    def update(self, network):
+        """Update device settings for the network's DHCP on this host."""
+        if not self.conf.enable_metadata_network:
+            self._set_default_route(network)
+
     def destroy(self, network, device_name):
         """Destroy the device used for the network's DHCP on this host."""
         if self.conf.use_namespaces:
Index: quantum-2013.1.3.a15.g9b38a4b/quantum/tests/unit/test_dhcp_agent.py
===================================================================
--- quantum-2013.1.3.a15.g9b38a4b.orig/quantum/tests/unit/test_dhcp_agent.py
+++ quantum-2013.1.3.a15.g9b38a4b/quantum/tests/unit/test_dhcp_agent.py
@@ -680,12 +680,14 @@ class TestDhcpAgentEventHandler(base.Bas
         payload = dict(subnet=dict(network_id=fake_network.id))
         self.cache.get_network_by_id.return_value = fake_network
         self.plugin.get_network_info.return_value = fake_network
+        self.dhcp.device_manager.update = mock.Mock()
 
         self.dhcp.subnet_update_end(None, payload)
 
         self.cache.assert_has_calls([mock.call.put(fake_network)])
         self.call_driver.assert_called_once_with('reload_allocations',
                                                  fake_network)
+        self.dhcp.device_manager.update.assert_called_once_with(fake_network)
 
     def test_subnet_update_end_restart(self):
         new_state = FakeModel(fake_network.id,
@@ -697,12 +699,14 @@ class TestDhcpAgentEventHandler(base.Bas
         payload = dict(subnet=dict(network_id=fake_network.id))
         self.cache.get_network_by_id.return_value = fake_network
         self.plugin.get_network_info.return_value = new_state
+        self.dhcp.device_manager.update = mock.Mock()
 
         self.dhcp.subnet_update_end(None, payload)
 
         self.cache.assert_has_calls([mock.call.put(new_state)])
         self.call_driver.assert_called_once_with('restart',
                                                  new_state)
+        self.dhcp.device_manager.update.assert_called_once_with(new_state)
 
     def test_subnet_update_end_delete_payload(self):
         prev_state = FakeModel(fake_network.id,
@@ -715,6 +719,7 @@ class TestDhcpAgentEventHandler(base.Bas
         self.cache.get_network_by_subnet_id.return_value = prev_state
         self.cache.get_network_by_id.return_value = prev_state
         self.plugin.get_network_info.return_value = fake_network
+        self.dhcp.device_manager.update = mock.Mock()
 
         self.dhcp.subnet_delete_end(None, payload)
 
@@ -725,6 +730,7 @@ class TestDhcpAgentEventHandler(base.Bas
             mock.call.put(fake_network)])
         self.call_driver.assert_called_once_with('restart',
                                                  fake_network)
+        self.dhcp.device_manager.update.assert_called_once_with(fake_network)
 
     def test_port_update_end(self):
         payload = dict(port=vars(fake_port2))
@@ -937,6 +943,44 @@ class TestNetworkCache(base.BaseTestCase
         self.assertEqual(nc.get_port_by_id(fake_port1.id), fake_port1)
 
 
+class FakePort1:
+    id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
+
+
+class FakeV4Subnet:
+    id = 'dddddddd-dddd-dddd-dddd-dddddddddddd'
+    ip_version = 4
+    cidr = '192.168.0.0/24'
+    gateway_ip = '192.168.0.1'
+    enable_dhcp = True
+
+
+class FakeV4SubnetNoGateway:
+    id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
+    ip_version = 4
+    cidr = '192.168.1.0/24'
+    gateway_ip = None
+    enable_dhcp = True
+
+
+class FakeV4Network:
+    id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
+    subnets = [FakeV4Subnet()]
+    ports = [FakePort1()]
+
+
+class FakeV4NetworkNoSubnet:
+    id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
+    subnets = []
+    ports = []
+
+
+class FakeV4NetworkNoGateway:
+    id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
+    subnets = [FakeV4SubnetNoGateway()]
+    ports = [FakePort1()]
+
+
 class TestDeviceManager(base.BaseTestCase):
     def setUp(self):
         super(TestDeviceManager, self).setUp()
@@ -981,6 +1025,7 @@ class TestDeviceManager(base.BaseTestCas
         self.mock_driver.get_device_name.return_value = 'tap12345678-12'
 
         dh = dhcp_agent.DeviceManager(cfg.CONF, plugin)
+        dh._set_default_route = mock.Mock()
         interface_name = dh.setup(net, reuse_existing)
 
         self.assertEqual(interface_name, 'tap12345678-12')
@@ -1004,6 +1049,8 @@ class TestDeviceManager(base.BaseTestCas
                                            namespace=namespace))
         self.mock_driver.assert_has_calls(expected)
 
+        dh._set_default_route.assert_called_once_with(net)
+
     def test_setup(self):
         self._test_setup_helper(False)
 
@@ -1118,6 +1165,125 @@ class TestDeviceManager(base.BaseTestCas
                 uuid5.called_once_with(uuid.NAMESPACE_DNS, 'localhost')
                 self.assertEqual(dh.get_device_id(fake_network), expected)
 
+    def _get_device_manager_with_mock_device(self, conf, device):
+            dh = dhcp_agent.DeviceManager(conf, None)
+            dh._get_device = mock.Mock(return_value=device)
+            return dh
+
+    def test_set_default_route(self):
+        device = mock.Mock()
+        device.route.get_gateway.return_value = None
+
+        # Basic one subnet with gateway.
+        dh = self._get_device_manager_with_mock_device(cfg.CONF, device)
+        network = FakeV4Network()
+
+        dh._set_default_route(network)
+
+        device.route.get_gateway.assert_called_once()
+        self.assertFalse(device.route.delete_gateway.called)
+        device.route.add_gateway.assert_called_once_with('192.168.0.1')
+
+    def test_set_default_route_no_namespaces(self):
+        device = mock.Mock()
+
+        # Try without namespaces.  Should do nothing.
+        cfg.CONF.set_override('use_namespaces', False)
+        dh = self._get_device_manager_with_mock_device(cfg.CONF, device)
+
+        dh._set_default_route(None)
+
+        self.assertFalse(device.route.get_gateway.called)
+        self.assertFalse(device.route.delete_gateway.called)
+        self.assertFalse(device.route.add_gateway.called)
+
+    def test_set_default_route_no_subnet(self):
+        device = mock.Mock()
+        device.route.get_gateway.return_value = None
+
+        # Try a namespace but no subnet.
+        dh = self._get_device_manager_with_mock_device(cfg.CONF, device)
+        network = FakeV4NetworkNoSubnet()
+
+        dh._set_default_route(network)
+
+        device.route.get_gateway.assert_called_once()
+        self.assertFalse(device.route.delete_gateway.called)
+        self.assertFalse(device.route.add_gateway.called)
+
+    def test_set_default_route_no_subnet_delete_gateway(self):
+        device = mock.Mock()
+        device.route.get_gateway.return_value = '192.168.0.1'
+
+        # Try a namespace but no subnet where a gateway needs to be deleted.
+        dh = self._get_device_manager_with_mock_device(cfg.CONF, device)
+        network = FakeV4NetworkNoSubnet()
+
+        dh._set_default_route(network)
+
+        device.route.get_gateway.assert_called_once()
+        device.route.delete_gateway.assert_called_once_with('192.168.0.1')
+        self.assertFalse(device.route.add_gateway.called)
+
+    def test_set_default_route_no_gateway(self):
+        device = mock.Mock()
+        device.route.get_gateway.return_value = '192.168.0.1'
+
+        # Try a subnet with no gateway
+        dh = self._get_device_manager_with_mock_device(cfg.CONF, device)
+        network = FakeV4NetworkNoGateway()
+
+        dh._set_default_route(network)
+
+        device.route.get_gateway.assert_called_once()
+        device.route.delete_gateway.assert_called_once_with('192.168.0.1')
+        self.assertFalse(device.route.add_gateway.called)
+
+    def test_set_default_route_do_nothing(self):
+        device = mock.Mock()
+        device.route.get_gateway.return_value = '192.168.0.1'
+
+        # Try a subnet where the gateway doesn't change.  Should do nothing.
+        dh = self._get_device_manager_with_mock_device(cfg.CONF, device)
+        network = FakeV4Network()
+
+        dh._set_default_route(network)
+
+        device.route.get_gateway.assert_called_once()
+        self.assertFalse(device.route.delete_gateway.called)
+        self.assertFalse(device.route.add_gateway.called)
+
+    def test_set_default_route_change_gateway(self):
+        device = mock.Mock()
+        device.route.get_gateway.return_value = '192.168.0.2'
+
+        # Try a subnet with a gateway this is different than the current.
+        dh = self._get_device_manager_with_mock_device(cfg.CONF, device)
+        network = FakeV4Network()
+
+        dh._set_default_route(network)
+
+        device.route.get_gateway.assert_called_once()
+        self.assertFalse(device.route.delete_gateway.called)
+        device.route.add_gateway.assert_called_once_with('192.168.0.1')
+
+    def test_set_default_route_two_subnets(self):
+        device = mock.Mock()
+        device.route.get_gateway.return_value = None
+
+        # Try two subnets.  Should set gateway from the first.
+        dh = self._get_device_manager_with_mock_device(cfg.CONF, device)
+        network = FakeV4Network()
+        subnet2 = FakeV4Subnet()
+        subnet2.gateway_ip = '192.168.1.1'
+        network.subnets = [subnet2, FakeV4Subnet()]
+
+        dh._set_default_route(network)
+
+        device.route.get_gateway.assert_called_once()
+        self.assertFalse(device.route.delete_gateway.called)
+        device.route.add_gateway.assert_called_once_with('192.168.1.1')
+
 
 class TestDhcpLeaseRelay(base.BaseTestCase):
     def setUp(self):
++++++ quantum-stable-grizzly.tar.gz ++++++
++++ 4151 lines of diff (skipped)

++++++ quantum-suse-config-defaults.diff ++++++
--- /var/tmp/diff_new_pack.0svqNu/_old  2013-06-20 21:26:22.000000000 +0200
+++ /var/tmp/diff_new_pack.0svqNu/_new  2013-06-20 21:26:22.000000000 +0200
@@ -1,6 +1,7 @@
-diff -urN b/quantum-2013.1/etc/dhcp_agent.ini 
a/quantum-2013.1/etc/dhcp_agent.ini
---- b/quantum-2013.1/etc/dhcp_agent.ini        2013-04-04 17:43:00.000000000 
+0200
-+++ a/quantum-2013.1/etc/dhcp_agent.ini        2013-04-05 15:35:38.486660941 
+0200
+Index: etc/dhcp_agent.ini
+===================================================================
+--- etc/dhcp_agent.ini.orig
++++ etc/dhcp_agent.ini
 @@ -11,12 +11,12 @@
  # matches you plugin.
  
@@ -16,9 +17,10 @@
  
  # The agent can use other DHCP drivers.  Dnsmasq is the simplest and requires
  # no additional setup of the DHCP server.
-diff -urN b/quantum-2013.1/etc/l3_agent.ini a/quantum-2013.1/etc/l3_agent.ini
---- b/quantum-2013.1/etc/l3_agent.ini  2013-04-04 17:43:00.000000000 +0200
-+++ a/quantum-2013.1/etc/l3_agent.ini  2013-04-05 15:35:22.410659237 +0200
+Index: etc/l3_agent.ini
+===================================================================
+--- etc/l3_agent.ini.orig
++++ etc/l3_agent.ini
 @@ -6,12 +6,12 @@
  # matches your plugin.
  
@@ -34,10 +36,20 @@
  
  # Allow overlapping IP (Must have kernel build with CONFIG_NET_NS=y and
  # iproute2 package that supports namespaces).
-diff -urN b/quantum-2013.1/etc/quantum.conf a/quantum-2013.1/etc/quantum.conf
---- b/quantum-2013.1/etc/quantum.conf  2013-04-04 17:43:05.000000000 +0200
-+++ a/quantum-2013.1/etc/quantum.conf  2013-04-05 15:33:54.142669807 +0200
-@@ -27,7 +27,7 @@
+@@ -36,7 +36,7 @@ interface_driver = quantum.agent.linux.i
+ 
+ # Name of bridge used for external network traffic. This should be set to
+ # empty value for the linux bridge
+-# external_network_bridge = br-ex
++external_network_bridge = br-ex
+ 
+ # TCP Port used by Quantum metadata server
+ # metadata_port = 9697
+Index: etc/quantum.conf
+===================================================================
+--- etc/quantum.conf.orig
++++ etc/quantum.conf
+@@ -27,7 +27,7 @@ lock_path = $state_path/lock
  
  # use_stderr = True
  # log_file =
@@ -46,7 +58,7 @@
  
  # publish_errors = False
  
-@@ -45,7 +45,7 @@
+@@ -45,7 +45,7 @@ bind_port = 9696
  # api_extensions_path =
  
  # Quantum plugin provider module
@@ -55,7 +67,7 @@
  
  # Advanced service modules
  # service_plugins =
-@@ -253,7 +253,7 @@
+@@ -268,7 +268,7 @@ notification_topics = notifications
  # Use "sudo quantum-rootwrap /etc/quantum/rootwrap.conf" to use the real
  # root filter facility.
  # Change to "sudo" to skip the filtering and just run the comand directly

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to