summaryrefslogtreecommitdiffstats
path: root/openstack
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-03-07 22:55:19 +0000
committerGerrit Code Review <review@openstack.org>2013-03-07 22:55:19 +0000
commit622f79311787c8a0b02d4999ada66810a97246e0 (patch)
tree37ca6b5ced87d7f93ec25db02554f97624727342 /openstack
parent27be16e6365b3fa38db94c2bbdcd80fa9cfdc3b7 (diff)
parent2e8b5e8446432542901b3c814670a4c67e629137 (diff)
downloadoslo-622f79311787c8a0b02d4999ada66810a97246e0.tar.gz
oslo-622f79311787c8a0b02d4999ada66810a97246e0.tar.xz
oslo-622f79311787c8a0b02d4999ada66810a97246e0.zip
Merge "Add 'is' operator to extra specs ops."
Diffstat (limited to 'openstack')
-rw-r--r--openstack/common/scheduler/filters/extra_specs_ops.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/openstack/common/scheduler/filters/extra_specs_ops.py b/openstack/common/scheduler/filters/extra_specs_ops.py
index f4d4ff4..9537e28 100644
--- a/openstack/common/scheduler/filters/extra_specs_ops.py
+++ b/openstack/common/scheduler/filters/extra_specs_ops.py
@@ -15,13 +15,17 @@
import operator
+from openstack.common import strutils
+
# 1. The following operations are supported:
-# =, s==, s!=, s>=, s>, s<=, s<, <in>, <or>, ==, !=, >=, <=
+# =, s==, s!=, s>=, s>, s<=, s<, <in>, <is>, <or>, ==, !=, >=, <=
# 2. Note that <or> is handled in a different way below.
# 3. If the first word in the extra_specs is not one of the operators,
# it is ignored.
_op_methods = {'=': lambda x, y: float(x) >= float(y),
'<in>': lambda x, y: y in x,
+ '<is>': lambda x, y: (strutils.bool_from_string(x) is
+ strutils.bool_from_string(y)),
'==': lambda x, y: float(x) == float(y),
'!=': lambda x, y: float(x) != float(y),
'>=': lambda x, y: float(x) >= float(y),