chiark / gitweb /
Makefile: Bring up to code.
[chopwood] / operation.py
index 50d79527f923e4b96108ac4387dbcbaaf35133cf..fccd172fc908ee5b7b9fa0895e735e8eb5d913fa 100644 (file)
@@ -179,7 +179,7 @@ class BaseRequest (object):
 
   It provides an empty `INFO' map; a simple `check' method which checks the
   operation name (in the class attribute `OP') against the configured policy
-  `CFG'ALLOWOP'; and the obvious `perform' method which assumes that the
+  `CFG.ALLOWOP'; and the obvious `perform' method which assumes that the
   `ops' list has already been constructed.
   """
 
@@ -343,14 +343,15 @@ def operate(op, accts, *args, **kw):
   """
   rq = getattr(CFG.RQCLASS, op)(accts, *args, **kw)
   desc = rq.describe()
-  try:
-    rq.check()
-  except U.ExpectedError, e:
-    L.syslog('REFUSE %s %s: %s' %
-             (desc,
-              ', '.join(['%s@%s' % (o.user, o.svc.name) for o in rq.ops]),
-              e))
-    raise
+  if not CFG.OPTS.ignpol:
+    try:
+      rq.check()
+    except U.ExpectedError, e:
+      L.syslog('REFUSE %s %s: %s' %
+               (desc,
+                ', '.join(['%s@%s' % (o.user, o.svc.name) for o in rq.ops]),
+                e))
+      raise
   ops = rq.perform()
   nwin = nlose = 0
   for o in ops: