Martin Sivák has uploaded a new change for review.

Change subject: Teach min and max to MoM policy parser
......................................................................

Teach min and max to MoM policy parser

Change-Id: I6fef9f562dd04ed8d9aab3fbac62d18e2d9885b9
Signed-off-by: Martin Sivak <[email protected]>
---
M mom/Policy/Parser.py
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/mom refs/changes/00/15800/1

diff --git a/mom/Policy/Parser.py b/mom/Policy/Parser.py
index 5bd400f..36c1d79 100644
--- a/mom/Policy/Parser.py
+++ b/mom/Policy/Parser.py
@@ -293,7 +293,8 @@
                     '<=': 'lte', '>=': 'gte',
                     '<<': 'shl', '>>': 'shr',
                     '==': 'eq', '!=': 'neq',
-                    'and': 'and', 'or': 'or', 'not': 'not'}
+                    'and': 'and', 'or': 'or', 'not': 'not',
+                    'min': 'min', 'max': 'max' }
 
     def __init__(self):
         GenericEvaluator.__init__(self)
@@ -431,6 +432,12 @@
     def c_not(self, x):
         return not x
 
+    def c_min(self, *args):
+        return min(args)
+
+    def c_max(self, *args):
+        return max(args)
+
 def get_code(e, string):
     try:
         scanner = Scanner(e.get_operators())


-- 
To view, visit http://gerrit.ovirt.org/15800
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6fef9f562dd04ed8d9aab3fbac62d18e2d9885b9
Gerrit-PatchSet: 1
Gerrit-Project: mom
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to