Hello community,

here is the log from the commit of package openstack-nova for openSUSE:Factory 
checked in at 2013-01-30 22:22:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openstack-nova (Old)
 and      /work/SRC/openSUSE:Factory/.openstack-nova.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "openstack-nova", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/openstack-nova/openstack-nova.changes    
2013-01-29 06:46:19.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.openstack-nova.new/openstack-nova.changes       
2013-01-30 22:22:55.000000000 +0100
@@ -0,0 +1,16 @@
+--------------------------------------------------------------------
+Wed Jan 30 07:09:51 UTC 2013 - [email protected]
+
+- Update to version 2012.2.3+git.1359529791.317cc0a:
+  + remove session parameter from fixed_ip_get
+  + Eliminate race conditions in floating association
+  + Fix to include error message in instance faults
+  + disallow boot from volume from specifying arbitrary volumes
+
+--------------------------------------------------------------------
+Fri Jan 25 10:59:36 UTC 2013 - [email protected]
+
+- Update to version 2012.2.3+git.1359111576.03c3e9b:
+  + Ensure that Quantum uses configured fixed IP
+  + Makes sure compute doesn't crash on failed resume.
+

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

Other differences:
------------------
++++++ openstack-nova-doc.spec ++++++
--- /var/tmp/diff_new_pack.YfqJxP/_old  2013-01-30 22:22:56.000000000 +0100
+++ /var/tmp/diff_new_pack.YfqJxP/_new  2013-01-30 22:22:56.000000000 +0100
@@ -20,7 +20,7 @@
 %define majorversion 2012.2.3
 
 Name:           openstack-%{component}-doc
-Version:        2012.2.3+git.1358515929.3545a7d
+Version:        2012.2.3+git.1359529791.317cc0a
 Release:        1
 License:        Apache-2.0
 Summary:        OpenStack Compute (Nova) - Documentation

++++++ openstack-nova.spec ++++++
--- /var/tmp/diff_new_pack.YfqJxP/_old  2013-01-30 22:22:56.000000000 +0100
+++ /var/tmp/diff_new_pack.YfqJxP/_new  2013-01-30 22:22:56.000000000 +0100
@@ -22,7 +22,7 @@
 %define username openstack-%{component}
 
 Name:           openstack-%{component}
-Version:        2012.2.3+git.1358515929.3545a7d
+Version:        2012.2.3+git.1359529791.317cc0a
 Release:        1
 License:        Apache-2.0
 Summary:        OpenStack Compute (Nova)

++++++ nova-stable-folsom.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/ChangeLog new/nova-2012.2.3/ChangeLog
--- old/nova-2012.2.3/ChangeLog 2013-01-18 00:55:36.000000000 +0100
+++ new/nova-2012.2.3/ChangeLog 2013-01-29 20:57:42.000000000 +0100
@@ -1,3 +1,68 @@
+commit 317cc0af385536dee43ef2addad50a91357fc1ad
+Author: Vishvananda Ishaya <[email protected]>
+Date:   Thu Jan 24 10:07:33 2013 +0000
+
+    disallow boot from volume from specifying arbitrary volumes
+    
+    Fix a vulnerability in volume attachment in nova-volume, affecting the
+    boot-from-volume feature.  By passing a specific volume ID, an
+    authenticated user may be able to boot from a volume they don't own,
+    potentially resulting in full access to that 3rd-party volume.
+    Folsom setups making use of Cinder are not affected.
+    
+    Fixes bug: 1069904, CVE-2013-0208
+    Change-Id: I5f7c8d20d3ebf33ce1ce64bf0a8418bd2b5a6411
+
+ nova/compute/api.py |   27 ++++++++++++++++++++++-----
+ nova/exception.py   |   14 ++++++++++++++
+ 2 files changed, 36 insertions(+), 5 deletions(-)
+
+commit 747fb95173ca715749b1417471f71e758d26cf91
+Merge: f6081d0 6241f91
+Author: Jenkins <[email protected]>
+Date:   Tue Jan 29 09:50:04 2013 +0000
+
+    Merge "Fix to include error message in instance faults" into stable/folsom
+
+commit f6081d01878f0021a499f304c511b6e1e9c8f138
+Merge: 1709c8e 5a66812
+Author: Jenkins <[email protected]>
+Date:   Fri Jan 25 12:48:41 2013 +0000
+
+    Merge "Eliminate race conditions in floating association" into 
stable/folsom
+
+commit 1709c8e755da9d9a31332608bd7f8d971098262c
+Merge: 03c3e9b 133a040
+Author: Jenkins <[email protected]>
+Date:   Fri Jan 25 12:48:27 2013 +0000
+
+    Merge "remove session parameter from fixed_ip_get" into stable/folsom
+
+commit 03c3e9b0674623c2617cb4dc98f9dd9fbddfa0ca
+Merge: cf67f3b 03200fe
+Author: Jenkins <[email protected]>
+Date:   Fri Jan 18 18:23:10 2013 +0000
+
+    Merge "Makes sure compute doesn't crash on failed resume." into 
stable/folsom
+
+commit cf67f3b89b38405647ac913c14a9d642600aa1ee
+Author: Gary Kotton <[email protected]>
+Date:   Mon Dec 31 14:46:51 2012 +0000
+
+    Ensure that Quantum uses configured fixed IP
+    
+    Fixes bug 1094897
+    
+    The fix ensures that the fixed IP address specified by the user
+    is correctly passed to Quantum. That is, when the Quantum port
+    is created it is created with the specified IP address.
+    
+    Change-Id: I8191ac2497037e2592b0679962e4606cd24d7844
+
+ nova/network/quantumv2/api.py        |    3 ++-
+ nova/tests/network/test_quantumv2.py |    3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
 commit 3545a7d77d4d9abbb193d6bc35ec0a10fb8f5ce0
 Merge: 02ff13b fcaab43
 Author: Jenkins <[email protected]>
@@ -54,6 +119,29 @@
 
     Merge "Limit formatting routes when adding resources" into stable/folsom
 
+commit 03200fe897ad507f3df2135a7c0bdadb72c0c9a0
+Author: Vishvananda Ishaya <[email protected]>
+Date:   Wed Jan 16 12:47:04 2013 -0800
+
+    Makes sure compute doesn't crash on failed resume.
+    
+    If the call to the driver to resume an instance raises an exception,
+    then nova-compute fails to start properly. This can happen during
+    recovery, for example, where an instance has been deleted so the
+    backing files are gone but the database is restored to a state
+    where it exists.
+    
+    This patch fixes the issue by catching the exception and setting
+    the instance to error.
+    
+    Fixes bug 1100430
+    
+    Change-Id: Ie31f39fcd43174c29bf7a5cb1b6fa29e4c723f97
+    (cherry picked from commit 3b4016184f83c71158d41db9a26e6043d9ae1506)
+
+ nova/compute/manager.py |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
 commit 796216e935781809e049c6a084962f73c7e0a23c
 Author: Morgan Fainberg <[email protected]>
 Date:   Tue Nov 27 13:00:48 2012 -0800
@@ -114,6 +202,27 @@
  nova/compute/resource_tracker.py |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
+commit 6241f91d153c23e0ffdccd2ff623cdb4b16538a6
+Author: Davanum Srinivas <[email protected]>
+Date:   Thu Nov 1 09:53:00 2012 -0400
+
+    Fix to include error message in instance faults
+    
+    port the patch in 1013350 from Bill Darbie (bill-darbie) into latest code 
base.
+    
+    incorporate one little comment from Russell about not specifying the 
default value twice
+    
+    added a test case
+    
+    Fixes bug 1013350
+    
+    Change-Id: Id61f10bf2502fa57d2d26199ba9608e4566e8624
+    (cherry picked from commit ce41618c9c24a866ccac19461653eba3b8e6dca4)
+
+ nova/compute/utils.py              |    7 ++++++-
+ nova/tests/compute/test_compute.py |   29 +++++++++++++++++++++++++++++
+ 2 files changed, 35 insertions(+), 1 deletion(-)
+
 commit 63fd557ec42ea59aa77a2d4aca3c4f9c301320fd
 Author: Vishvananda Ishaya <[email protected]>
 Date:   Wed Nov 7 23:28:28 2012 -0800
@@ -137,6 +246,45 @@
  .../tests/api/openstack/compute/test_extensions.py |   28 ++++++++++++++++++++
  2 files changed, 37 insertions(+)
 
+commit 5a6681222999873f0df9816125fe9888498d91c2
+Author: Vishvananda Ishaya <[email protected]>
+Date:   Thu Dec 20 20:13:37 2012 -0800
+
+    Eliminate race conditions in floating association
+    
+    This makes associating and disassociating floating ips atomic and
+    idempotent. This means multiple concurrent messages will not leave
+    behind iptables rules and concurrent request will not cause odd
+    failures.
+    
+    Fixes bug 1092762 and bug 1092761.
+    
+    Change-Id: Idbcad6c1d2a3d4881cf7180b848ed3844fac4054
+    (cherry picked from commit 881a93473c32a7c7e23a8e6dcede8394053408c6)
+
+ nova/db/api.py                     |   10 ++++-
+ nova/db/sqlalchemy/api.py          |    3 ++
+ nova/network/manager.py            |   82 +++++++++++++++++++++++-------------
+ nova/tests/network/test_manager.py |    2 +-
+ nova/tests/test_db_api.py          |   15 +++++++
+ 5 files changed, 79 insertions(+), 33 deletions(-)
+
+commit 133a0402bcf4c4c37dd54cf5a6265726761becc4
+Author: Devananda van der Veen <[email protected]>
+Date:   Sat Oct 27 16:16:23 2012 -0700
+
+    remove session parameter from fixed_ip_get
+    
+    Remove session parameter from public method fixed_ip_get.
+    This requires some changes to floating_ip_disassociate,
+    but doesn't appear to affect anything else.
+    
+    Change-Id: I435bfc4f2f4175049fd164fea37b4724871e1eb1
+    (cherry picked from commit 88ac5d532dfdbeeed5a5c7e295e3a5962a792e41)
+
+ nova/db/sqlalchemy/api.py |   23 ++++++++++++++---------
+ 1 file changed, 14 insertions(+), 9 deletions(-)
+
 commit 4bfc8f1165b05c2cc7c5506641b9b85fa8e1e144
 Author: Adam Gandelman <[email protected]>
 Date:   Tue Dec 18 09:50:46 2012 -0800
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/compute/api.py 
new/nova-2012.2.3/nova/compute/api.py
--- old/nova-2012.2.3/nova/compute/api.py       2013-01-18 00:51:37.000000000 
+0100
+++ new/nova-2012.2.3/nova/compute/api.py       2013-01-29 20:53:38.000000000 
+0100
@@ -507,6 +507,11 @@
                         security_group, block_device_mapping)
                 instances.append(instance)
                 instance_uuids.append(instance['uuid'])
+                self._validate_bdm(context, instance)
+                # send a state update notification for the initial create to
+                # show it going from non-existent to BUILDING
+                notifications.send_update_with_states(context, instance, None,
+                        vm_states.BUILDING, None, None, service="api")
 
         # In the case of any exceptions, attempt DB cleanup and rollback the
         # quota reservations.
@@ -623,6 +628,23 @@
             self.db.block_device_mapping_update_or_create(elevated_context,
                                                           values)
 
+    def _validate_bdm(self, context, instance):
+        for bdm in self.db.block_device_mapping_get_all_by_instance(
+                context, instance['uuid']):
+            # NOTE(vish): For now, just make sure the volumes are accessible.
+            snapshot_id = bdm.get('snapshot_id')
+            volume_id = bdm.get('volume_id')
+            if volume_id is not None:
+                try:
+                    self.volume_api.get(context, volume_id)
+                except Exception:
+                    raise exception.InvalidBDMVolume(id=volume_id)
+            elif snapshot_id is not None:
+                try:
+                    self.volume_api.get_snapshot(context, snapshot_id)
+                except Exception:
+                    raise exception.InvalidBDMSnapshot(id=snapshot_id)
+
     def _populate_instance_for_bdm(self, context, instance, instance_type,
             image, block_device_mapping):
         """Populate instance block device mapping information."""
@@ -735,11 +757,6 @@
         self._populate_instance_for_bdm(context, instance,
                 instance_type, image, block_device_mapping)
 
-        # send a state update notification for the initial create to
-        # show it going from non-existent to BUILDING
-        notifications.send_update_with_states(context, instance, None,
-                vm_states.BUILDING, None, None, service="api")
-
         return instance
 
     def _check_create_policies(self, context, availability_zone,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/compute/manager.py 
new/nova-2012.2.3/nova/compute/manager.py
--- old/nova-2012.2.3/nova/compute/manager.py   2013-01-18 00:51:40.000000000 
+0100
+++ new/nova-2012.2.3/nova/compute/manager.py   2013-01-29 20:53:38.000000000 
+0100
@@ -314,6 +314,14 @@
                     except NotImplementedError:
                         LOG.warning(_('Hypervisor driver does not support '
                                       'resume guests'), instance=instance)
+                    except Exception:
+                        # NOTE(vish): The instance failed to resume, so we
+                        #             set the instance to error and attempt
+                        #             to continue.
+                        LOG.warning(_('Failed to resume instance'),
+                                    instance=instance)
+                        self._set_instance_error_state(context,
+                                                       instance['uuid'])
 
                 elif drv_state == power_state.RUNNING:
                     # VMWareAPI drivers will raise an exception
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/compute/utils.py 
new/nova-2012.2.3/nova/compute/utils.py
--- old/nova-2012.2.3/nova/compute/utils.py     2013-01-18 00:51:37.000000000 
+0100
+++ new/nova-2012.2.3/nova/compute/utils.py     2013-01-29 20:53:38.000000000 
+0100
@@ -39,8 +39,13 @@
     """Adds the specified fault to the database."""
 
     code = 500
+    message = fault.__class__.__name__
+
     if hasattr(fault, "kwargs"):
         code = fault.kwargs.get('code', 500)
+        # get the message from the exception that was thrown
+        # if that does not exist, use the name of the exception class itself
+        message = fault.kwargs.get('value', message)
 
     details = unicode(fault)
     if exc_info and code == 500:
@@ -50,7 +55,7 @@
     values = {
         'instance_uuid': instance_uuid,
         'code': code,
-        'message': fault.__class__.__name__,
+        'message': unicode(message),
         'details': unicode(details),
     }
     db.instance_fault_create(context, values)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/db/api.py 
new/nova-2012.2.3/nova/db/api.py
--- old/nova-2012.2.3/nova/db/api.py    2013-01-18 00:51:37.000000000 +0100
+++ new/nova-2012.2.3/nova/db/api.py    2013-01-29 20:53:38.000000000 +0100
@@ -303,7 +303,8 @@
 def floating_ip_disassociate(context, address):
     """Disassociate a floating ip from a fixed ip by address.
 
-    :returns: the address of the existing fixed ip.
+    :returns: the address of the previous fixed ip or None
+              if the ip was not associated to an ip.
 
     """
     return IMPL.floating_ip_disassociate(context, address)
@@ -311,7 +312,12 @@
 
 def floating_ip_fixed_ip_associate(context, floating_address,
                                    fixed_address, host):
-    """Associate a floating ip to a fixed_ip by address."""
+    """Associate a floating ip to a fixed_ip by address.
+
+    :returns: the address of the new fixed ip (fixed_address) or None
+              if the ip was already associated to the fixed ip.
+    """
+
     return IMPL.floating_ip_fixed_ip_associate(context,
                                                floating_address,
                                                fixed_address,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/db/sqlalchemy/api.py 
new/nova-2012.2.3/nova/db/sqlalchemy/api.py
--- old/nova-2012.2.3/nova/db/sqlalchemy/api.py 2013-01-18 00:51:37.000000000 
+0100
+++ new/nova-2012.2.3/nova/db/sqlalchemy/api.py 2013-01-29 20:53:38.000000000 
+0100
@@ -812,9 +812,12 @@
         fixed_ip_ref = fixed_ip_get_by_address(context,
                                                fixed_address,
                                                session=session)
+        if floating_ip_ref.fixed_ip_id == fixed_ip_ref["id"]:
+            return None
         floating_ip_ref.fixed_ip_id = fixed_ip_ref["id"]
         floating_ip_ref.host = host
         floating_ip_ref.save(session=session)
+        return fixed_address
 
 
 @require_context
@@ -844,11 +847,17 @@
 def floating_ip_disassociate(context, address):
     session = get_session()
     with session.begin():
-        floating_ip_ref = floating_ip_get_by_address(context,
-                                                     address,
-                                                     session=session)
-        fixed_ip_ref = fixed_ip_get(context,
-                                    floating_ip_ref['fixed_ip_id'])
+        floating_ip_ref = model_query(context,
+                                      models.FloatingIp,
+                                      session=session).\
+                            filter_by(address=address).\
+                            first()
+        if not floating_ip_ref:
+            raise exception.FloatingIpNotFoundForAddress(address=address)
+
+        fixed_ip_ref = model_query(context, models.FixedIp, session=session).\
+                            filter_by(id=floating_ip_ref['fixed_ip_id']).\
+                            first()
         if fixed_ip_ref:
             fixed_ip_address = fixed_ip_ref['address']
         else:
@@ -1163,8 +1172,8 @@
 
 
 @require_context
-def fixed_ip_get(context, id, session=None):
-    result = model_query(context, models.FixedIp, session=session).\
+def fixed_ip_get(context, id):
+    result = model_query(context, models.FixedIp).\
                      filter_by(id=id).\
                      first()
     if not result:
@@ -1174,8 +1183,7 @@
     # results?
     if is_user_context(context) and result['instance_uuid'] is not None:
         instance = instance_get_by_uuid(context.elevated(read_deleted='yes'),
-                                        result['instance_uuid'],
-                                        session)
+                                        result['instance_uuid'])
         authorize_project_context(context, instance.project_id)
 
     return result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/exception.py 
new/nova-2012.2.3/nova/exception.py
--- old/nova-2012.2.3/nova/exception.py 2013-01-18 00:51:37.000000000 +0100
+++ new/nova-2012.2.3/nova/exception.py 2013-01-29 20:53:38.000000000 +0100
@@ -223,6 +223,20 @@
     message = _("Invalid snapshot") + ": %(reason)s"
 
 
+class InvalidBDM(Invalid):
+    message = _("Block Device Mapping is Invalid.")
+
+
+class InvalidBDMSnapshot(InvalidBDM):
+    message = _("Block Device Mapping is Invalid: "
+                "failed to get snapshot %(id)s.")
+
+
+class InvalidBDMVolume(InvalidBDM):
+    message = _("Block Device Mapping is Invalid: "
+                "failed to get volume %(id)s.")
+
+
 class VolumeUnattached(Invalid):
     message = _("Volume %(volume_id)s is not attached to anything")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/network/manager.py 
new/nova-2012.2.3/nova/network/manager.py
--- old/nova-2012.2.3/nova/network/manager.py   2013-01-18 00:51:37.000000000 
+0100
+++ new/nova-2012.2.3/nova/network/manager.py   2013-01-29 20:53:38.000000000 
+0100
@@ -555,27 +555,34 @@
     def _associate_floating_ip(self, context, floating_address, fixed_address,
                                interface):
         """Performs db and driver calls to associate floating ip & fixed ip"""
-        # associate floating ip
-        self.db.floating_ip_fixed_ip_associate(context,
-                                               floating_address,
-                                               fixed_address,
-                                               self.host)
-        try:
-            # gogo driver time
-            self.l3driver.add_floating_ip(floating_address, fixed_address,
-                    interface)
-        except exception.ProcessExecutionError as e:
-            fixed_address = self.db.floating_ip_disassociate(context,
-                                                             floating_address)
-            if "Cannot find device" in str(e):
-                LOG.error(_('Interface %(interface)s not found'), locals())
-                raise exception.NoFloatingIpInterface(interface=interface)
-        payload = dict(project_id=context.project_id,
-                       floating_ip=floating_address)
-        notifier.notify(context,
-                        notifier.publisher_id("network"),
-                        'network.floating_ip.associate',
-                        notifier.INFO, payload=payload)
+
+        @utils.synchronized(unicode(floating_address))
+        def do_associate():
+            # associate floating ip
+            res = self.db.floating_ip_fixed_ip_associate(context,
+                                                         floating_address,
+                                                         fixed_address,
+                                                         self.host)
+            if not res:
+                # NOTE(vish): ip was already associated
+                return
+            try:
+                # gogo driver time
+                self.l3driver.add_floating_ip(floating_address, fixed_address,
+                        interface)
+            except exception.ProcessExecutionError as e:
+                self.db.floating_ip_disassociate(context, floating_address)
+                if "Cannot find device" in str(e):
+                    LOG.error(_('Interface %(interface)s not found'), locals())
+                    raise exception.NoFloatingIpInterface(interface=interface)
+
+            payload = dict(project_id=context.project_id,
+                           floating_ip=floating_address)
+            notifier.notify(context,
+                            notifier.publisher_id("network"),
+                            'network.floating_ip.associate',
+                            notifier.INFO, payload=payload)
+        do_associate()
 
     @wrap_check_policy
     def disassociate_floating_ip(self, context, address,
@@ -635,16 +642,31 @@
     def _disassociate_floating_ip(self, context, address, interface):
         """Performs db and driver calls to disassociate floating ip"""
         # disassociate floating ip
-        fixed_address = self.db.floating_ip_disassociate(context, address)
 
-        if interface:
-            # go go driver time
-            self.l3driver.remove_floating_ip(address, fixed_address, interface)
-        payload = dict(project_id=context.project_id, floating_ip=address)
-        notifier.notify(context,
-                        notifier.publisher_id("network"),
-                        'network.floating_ip.disassociate',
-                        notifier.INFO, payload=payload)
+        @utils.synchronized(unicode(address))
+        def do_disassociate():
+            # NOTE(vish): Note that we are disassociating in the db before we
+            #             actually remove the ip address on the host. We are
+            #             safe from races on this host due to the decorator,
+            #             but another host might grab the ip right away. We
+            #             don't worry about this case because the miniscule
+            #             window where the ip is on both hosts shouldn't cause
+            #             any problems.
+            fixed_address = self.db.floating_ip_disassociate(context, address)
+
+            if not fixed_address:
+                # NOTE(vish): ip was already disassociated
+                return
+            if interface:
+                # go go driver time
+                self.l3driver.remove_floating_ip(address, fixed_address,
+                                                 interface)
+            payload = dict(project_id=context.project_id, floating_ip=address)
+            notifier.notify(context,
+                            notifier.publisher_id("network"),
+                            'network.floating_ip.disassociate',
+                            notifier.INFO, payload=payload)
+        do_disassociate()
 
     @wrap_check_policy
     def get_floating_ip(self, context, id):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/network/quantumv2/api.py 
new/nova-2012.2.3/nova/network/quantumv2/api.py
--- old/nova-2012.2.3/nova/network/quantumv2/api.py     2013-01-18 
00:51:37.000000000 +0100
+++ new/nova-2012.2.3/nova/network/quantumv2/api.py     2013-01-29 
20:53:38.000000000 +0100
@@ -136,7 +136,8 @@
                     touched_port_ids.append(port['id'])
                 else:
                     if fixed_ips.get(network_id):
-                        port_req_body['port']['fixed_ip'] = fixed_ip
+                        port_req_body['port']['fixed_ips'] = [{'ip_address':
+                                                               fixed_ip}]
                     port_req_body['port']['network_id'] = network_id
                     port_req_body['port']['admin_state_up'] = True
                     port_req_body['port']['tenant_id'] = instance['project_id']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/tests/compute/test_compute.py 
new/nova-2012.2.3/nova/tests/compute/test_compute.py
--- old/nova-2012.2.3/nova/tests/compute/test_compute.py        2013-01-18 
00:51:38.000000000 +0100
+++ new/nova-2012.2.3/nova/tests/compute/test_compute.py        2013-01-29 
20:53:38.000000000 +0100
@@ -2343,6 +2343,35 @@
                                                   NotImplementedError('test'),
                                                   exc_info)
 
+    def test_add_instance_fault_with_remote_error(self):
+        exc_info = None
+        instance_uuid = str(utils.gen_uuid())
+
+        def fake_db_fault_create(ctxt, values):
+            self.assertTrue(values['details'].startswith('Remote error'))
+            self.assertTrue('raise rpc_common.RemoteError'
+                in values['details'])
+            del values['details']
+
+            expected = {
+                'code': 500,
+                'instance_uuid': instance_uuid,
+                'message': 'My Test Message'
+            }
+            self.assertEquals(expected, values)
+
+        try:
+            raise rpc_common.RemoteError('test', 'My Test Message')
+        except rpc_common.RemoteError as exc:
+            exc_info = sys.exc_info()
+
+        self.stubs.Set(nova.db, 'instance_fault_create', fake_db_fault_create)
+
+        ctxt = context.get_admin_context()
+        compute_utils.add_instance_fault_from_exc(ctxt, instance_uuid,
+            exc,
+            exc_info)
+
     def test_add_instance_fault_user_error(self):
         exc_info = None
         instance_uuid = str(utils.gen_uuid())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/tests/network/test_manager.py 
new/nova-2012.2.3/nova/tests/network/test_manager.py
--- old/nova-2012.2.3/nova/tests/network/test_manager.py        2013-01-18 
00:51:38.000000000 +0100
+++ new/nova-2012.2.3/nova/tests/network/test_manager.py        2013-01-29 
20:53:38.000000000 +0100
@@ -639,7 +639,7 @@
                                       is_admin=False)
 
         def fake1(*args, **kwargs):
-            pass
+            return '10.0.0.1'
 
         # floating ip that's already associated
         def fake2(*args, **kwargs):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/tests/network/test_quantumv2.py 
new/nova-2012.2.3/nova/tests/network/test_quantumv2.py
--- old/nova-2012.2.3/nova/tests/network/test_quantumv2.py      2013-01-18 
00:51:38.000000000 +0100
+++ new/nova-2012.2.3/nova/tests/network/test_quantumv2.py      2013-01-29 
20:53:38.000000000 +0100
@@ -393,7 +393,8 @@
             else:
                 fixed_ip = fixed_ips.get(net_id)
                 if fixed_ip:
-                    port_req_body['port']['fixed_ip'] = fixed_ip
+                    port_req_body['port']['fixed_ips'] = [{'ip_address':
+                                                           fixed_ip}]
                 port_req_body['port']['network_id'] = net_id
                 port_req_body['port']['admin_state_up'] = True
                 port_req_body['port']['tenant_id'] = \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nova-2012.2.3/nova/tests/test_db_api.py 
new/nova-2012.2.3/nova/tests/test_db_api.py
--- old/nova-2012.2.3/nova/tests/test_db_api.py 2013-01-18 00:51:38.000000000 
+0100
+++ new/nova-2012.2.3/nova/tests/test_db_api.py 2013-01-29 20:53:38.000000000 
+0100
@@ -207,6 +207,21 @@
         self.assertEqual(0, len(results))
         db.instance_update(ctxt, instance['uuid'], {"task_state": None})
 
+    def test_multi_associate_disassociate(self):
+        ctxt = context.get_admin_context()
+        values = {'address': 'floating'}
+        floating = db.floating_ip_create(ctxt, values)
+        values = {'address': 'fixed'}
+        fixed = db.fixed_ip_create(ctxt, values)
+        res = db.floating_ip_fixed_ip_associate(ctxt, floating, fixed, 'foo')
+        self.assertEqual(res, fixed)
+        res = db.floating_ip_fixed_ip_associate(ctxt, floating, fixed, 'foo')
+        self.assertEqual(res, None)
+        res = db.floating_ip_disassociate(ctxt, floating)
+        self.assertEqual(res, fixed)
+        res = db.floating_ip_disassociate(ctxt, floating)
+        self.assertEqual(res, None)
+
     def test_network_create_safe(self):
         ctxt = context.get_admin_context()
         values = {'host': 'localhost', 'project_id': 'project1'}

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

Reply via email to