xenserver: Fix iteration of dictionary.
authorDominic Curran <dominic.curran@citrix.com>
Wed, 15 Feb 2012 17:17:25 +0000 (17:17 +0000)
committerBen Pfaff <blp@nicira.com>
Wed, 15 Feb 2012 17:48:28 +0000 (09:48 -0800)
Fix bug in commit 3249bb907a1dab9b0, which incorrectly assumed that
get_all_records_where() returned a list.  It in fact returns a
dictionary and the list iteratory needs to change to account for this.

Thanks to Nicira for pointing this out.

NIC-454.

Reported-by: David Tsai <dtsai@nicira.com>
Acked-by: Rob Hoes <rob.hoes@citrix.com>
Signed-off-by: Dominic Curran <dominic.curran@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
AUTHORS
xenserver/etc_xapi.d_plugins_openvswitch-cfg-update

diff --git a/AUTHORS b/AUTHORS
index cd7c9d3b4ccbdbfbeb2263732037b2658297847e..58f7eccd32615f58d95db3abb86394bc26e6fd82 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -16,6 +16,7 @@ Dan Wendlandt           dan@nicira.com
 Daniel Roman            droman@nicira.com
 David Erickson          derickso@stanford.edu
 Devendra Naga           devendra.aaru@gmail.com
+Dominic Curran          dominic.curran@citrix.com
 Edward Tomasz NapieraƂa trasz@freebsd.org
 Ethan Jackson           ethan@nicira.com
 Gaetano Catalli         gaetano.catalli@gmail.com
@@ -76,7 +77,6 @@ Bryan Osoro             bosoro@nicira.com
 Cedric Hobbs            cedric@nicira.com
 Dave Walker             DaveWalker@ubuntu.com
 Derek Cormier           derek.cormier@lab.ntt.co.jp
-Dominic Curran          dominic.curran@citrix.com
 Duffie Cooley           dcooley@nicira.com
 DK Moon                 dkmoon@nicira.com
 Edwin Chiu              echiu@nicira.com
index a9a10e83ff5c5f6ec140c5b1cbe0b481952f618c..ef4d11a8e4933961513b63d5aae4135ea9e7af05 100755 (executable)
@@ -100,7 +100,7 @@ def update(session, args):
     pool_mgmt_macs = {}
     if new_controller:
         recs = session.xenapi.PIF.get_all_records_where('field "management"="true"')
-        for rec in recs:
+        for rec in recs.itervalues():
             pool_mgmt_macs[rec.get('MAC')] = rec.get('device')
 
     dib_changed = False