コード例 #1
0
 def defer(self):
     # Return a deferred variable if we aren't on a node.
     if not self._in_alloc:
         return DeferredVariable(func.__name__,
                                 var_set='sched',
                                 sub_keys=sub_keys)
     else:
         return str(func(self))
コード例 #2
0
ファイル: schedulers.py プロジェクト: coneheadusa/pavilion2
 def defer(self):
     """Return a deferred variable if we aren't on a node."""
     if not self.sched.in_alloc:
         return DeferredVariable()
     else:
         value = func(self)
         norm_val = normalize_value(value)
         if norm_val is None:
             raise ValueError(
                 "Invalid variable value returned by {}: {}.".format(
                     func.__name__, value))
         return norm_val
コード例 #3
0
 def defer(self):
     """Return a deferred variable if we aren't on a node."""
     if not self.sched.in_alloc:
         return DeferredVariable()
     else:
         return str(func(self))