diff options
| author | Salvatore Orlando <salvatore.orlando@eu.citrix.com> | 2011-06-25 02:16:20 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-06-25 02:16:20 +0000 |
| commit | e6f3ce3541d3ce380c00dda3b878a652fc31f2fc (patch) | |
| tree | 4ed0ee4b3eab5059416a5da38022d2acf02e3102 | |
| parent | 9f5a604e24b259a76dfc0db6e090433667b6f050 (diff) | |
| parent | 35e922a2db9b45314108b35e438e9229bea4b977 (diff) | |
| download | nova-e6f3ce3541d3ce380c00dda3b878a652fc31f2fc.tar.gz nova-e6f3ce3541d3ce380c00dda3b878a652fc31f2fc.tar.xz nova-e6f3ce3541d3ce380c00dda3b878a652fc31f2fc.zip | |
This small change restores single quotes and double quotes as they were before in the filter expression for retrieving the PIF (physical interface) xenapi should use for creating VLAN interfaces.
I'm not sure why they were altered, possibly because of coding style conventions, but unfortunately xenapi does not accept single quotes for separating filter expression tokens.
| -rw-r--r-- | nova/network/xenapi_net.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nova/network/xenapi_net.py b/nova/network/xenapi_net.py index 709ef7f34..af295a4f8 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(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) pif_ref = None # Multiple PIF are ok: we are dealing with a pool |
