From 260af1f3edb7993a6b6374563ef2b46c7fa700df Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Mon, 20 Jun 2011 15:55:02 +0100 Subject: Enclosing tokens for xenapi filter in double quotes --- nova/network/xenapi_net.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nova/network/xenapi_net.py b/nova/network/xenapi_net.py index 709ef7f34..7976a7265 100644 --- a/nova/network/xenapi_net.py +++ b/nova/network/xenapi_net.py @@ -56,8 +56,10 @@ def ensure_vlan_bridge(vlan_num, bridge, net_attrs=None): 'other_config': {}} network_ref = session.call_xenapi('network.create', network_rec) # 2 - find PIF for VLAN - expr = "field 'device' = '%s' and \ - field 'VLAN' = '-1'" % FLAGS.vlan_interface + # Note using double quotes inside single quotes as xapi filter + # only support tokens in double quotes + expr = 'field "device" = "%s" and \ + field "VLAN" = "-1"' % FLAGS.vlan_interface pifs = session.call_xenapi('PIF.get_all_records_where', expr) pif_ref = None # Multiple PIF are ok: we are dealing with a pool -- cgit From 35e922a2db9b45314108b35e438e9229bea4b977 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Tue, 21 Jun 2011 11:39:55 +0100 Subject: fix comment line --- nova/network/xenapi_net.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/network/xenapi_net.py b/nova/network/xenapi_net.py index 7976a7265..af295a4f8 100644 --- a/nova/network/xenapi_net.py +++ b/nova/network/xenapi_net.py @@ -56,8 +56,8 @@ def ensure_vlan_bridge(vlan_num, bridge, net_attrs=None): 'other_config': {}} network_ref = session.call_xenapi('network.create', network_rec) # 2 - find PIF for VLAN - # Note using double quotes inside single quotes as xapi filter - # only support tokens in double quotes + # NOTE(salvatore-orlando): using double quotes inside single quotes + # as xapi filter only support tokens in double quotes expr = 'field "device" = "%s" and \ field "VLAN" = "-1"' % FLAGS.vlan_interface pifs = session.call_xenapi('PIF.get_all_records_where', expr) -- cgit