Пример #1
0
 def deserialize(stub):
     dataTuple, _slen = DEncode.decode(stub)
     if len(dataTuple) != 7:
         return S_ERROR("Invalid stub")
     #jid
     if type(dataTuple[0]) not in (types.IntType, types.LongType):
         return S_ERROR("Invalid stub 0")
     #cache
     if type(dataTuple[1]) != types.DictType:
         return S_ERROR("Invalid stub 1")
     #trace
     if type(dataTuple[2]) != types.ListType:
         return S_ERROR("Invalid stub 2")
     #manifest
     tdt3 = type(dataTuple[3])
     if tdt3 != types.NoneType and (tdt3 != types.TupleType
                                    and len(dataTuple[3]) != 2):
         return S_ERROR("Invalid stub 3")
     #initstate
     if type(dataTuple[4]) != types.DictType:
         return S_ERROR("Invalid stub 4")
     #Insert into TQ
     if type(dataTuple[5]) != types.BooleanType:
         return S_ERROR("Invalid stub 5")
     #Dirty Keys
     if type(dataTuple[6]) != types.TupleType:
         return S_ERROR("Invalid stub 6")
     cjs = CachedJobState(dataTuple[0], skipInitState=True)
     cjs.__cache = dataTuple[1]
     cjs.__jobLog = dataTuple[2]
     dt3 = dataTuple[3]
     if dataTuple[3]:
         manifest = JobManifest()
         result = manifest.loadCFG(dt3[0])
         if not result['OK']:
             return result
         if dt3[1]:
             manifest.setDirty()
         else:
             manifest.clearDirty()
         cjs.__manifest = manifest
     cjs.__initState = dataTuple[4]
     cjs.__insertIntoTQ = dataTuple[5]
     cjs.__dirtyKeys = set(dataTuple[6])
     return S_OK(cjs)
Пример #2
0
 def deserialize(stub):
     dataTuple, _slen = DEncode.decode(stub.encode())
     if len(dataTuple) != 7:
         return S_ERROR("Invalid stub")
     # jid
     if not isinstance(dataTuple[0], int):
         return S_ERROR("Invalid stub 0")
     # cache
     if not isinstance(dataTuple[1], dict):
         return S_ERROR("Invalid stub 1")
     # trace
     if not isinstance(dataTuple[2], list):
         return S_ERROR("Invalid stub 2")
     # manifest
     if dataTuple[3] is not None and (
             not isinstance(dataTuple[3],
                            (tuple, list)) and len(dataTuple[3]) != 2):
         return S_ERROR("Invalid stub 3")
     # initstate
     if not isinstance(dataTuple[4], dict):
         return S_ERROR("Invalid stub 4")
     # Insert into TQ
     if not isinstance(dataTuple[5], bool):
         return S_ERROR("Invalid stub 5")
     # Dirty Keys
     if not isinstance(dataTuple[6], (tuple, list)):
         return S_ERROR("Invalid stub 6")
     cjs = CachedJobState(dataTuple[0], skipInitState=True)
     cjs.__cache = dataTuple[1]
     cjs.__jobLog = dataTuple[2]
     dt3 = dataTuple[3]
     if dataTuple[3]:
         manifest = JobManifest()
         result = manifest.loadCFG(dt3[0])
         if not result["OK"]:
             return result
         if dt3[1]:
             manifest.setDirty()
         else:
             manifest.clearDirty()
         cjs.__manifest = manifest
     cjs.__initState = dataTuple[4]
     cjs.__insertIntoTQ = dataTuple[5]
     cjs.__dirtyKeys = set(dataTuple[6])
     return S_OK(cjs)
Пример #3
0
 def deserialize(stub):
     dataTuple, slen = DEncode.decode(stub)
     if len(dataTuple) != 7:
         return S_ERROR("Invalid stub")
     # jid
     if type(dataTuple[0]) not in (types.IntType, types.LongType):
         return S_ERROR("Invalid stub 0")
     # cache
     if type(dataTuple[1]) != types.DictType:
         return S_ERROR("Invalid stub 1")
     # trace
     if type(dataTuple[2]) != types.ListType:
         return S_ERROR("Invalid stub 2")
     # manifest
     tdt3 = type(dataTuple[3])
     if tdt3 != types.NoneType and (tdt3 != types.TupleType and len(dataTuple[3]) != 2):
         return S_ERROR("Invalid stub 3")
     # initstate
     if type(dataTuple[4]) != types.DictType:
         return S_ERROR("Invalid stub 4")
     # Insert into TQ
     if type(dataTuple[5]) != types.BooleanType:
         return S_ERROR("Invalid stub 5")
     # Dirty Keys
     if type(dataTuple[6]) != types.TupleType:
         return S_ERROR("Invalid stub 6")
     cjs = CachedJobState(dataTuple[0], skipInitState=True)
     cjs.__cache = dataTuple[1]
     cjs.__jobLog = dataTuple[2]
     dt3 = dataTuple[3]
     if dataTuple[3]:
         manifest = JobManifest()
         result = manifest.loadCFG(dt3[0])
         if not result["OK"]:
             return result
         if dt3[1]:
             manifest.setDirty()
         else:
             manifest.clearDirty()
         cjs.__manifest = manifest
     cjs.__initState = dataTuple[4]
     cjs.__insertIntoTQ = dataTuple[5]
     cjs.__dirtyKeys = set(dataTuple[6])
     return S_OK(cjs)
Пример #4
0
 def deserialize(stub):
   dataTuple, _slen = DEncode.decode(stub)
   if len(dataTuple) != 7:
     return S_ERROR("Invalid stub")
   # jid
   if not isinstance(dataTuple[0], (int, long)):
     return S_ERROR("Invalid stub 0")
   # cache
   if not isinstance(dataTuple[1], dict):
     return S_ERROR("Invalid stub 1")
   # trace
   if not isinstance(dataTuple[2], list):
     return S_ERROR("Invalid stub 2")
   # manifest
   if dataTuple[3] is not None and (not isinstance(dataTuple[3], tuple) and len(dataTuple[3]) != 2):
     return S_ERROR("Invalid stub 3")
   # initstate
   if not isinstance(dataTuple[4], dict):
     return S_ERROR("Invalid stub 4")
   # Insert into TQ
   if not isinstance(dataTuple[5], bool):
     return S_ERROR("Invalid stub 5")
   # Dirty Keys
   if not isinstance(dataTuple[6], tuple):
     return S_ERROR("Invalid stub 6")
   cjs = CachedJobState(dataTuple[0], skipInitState=True)
   cjs.__cache = dataTuple[1]
   cjs.__jobLog = dataTuple[2]
   dt3 = dataTuple[3]
   if dataTuple[3]:
     manifest = JobManifest()
     result = manifest.loadCFG(dt3[0])
     if not result['OK']:
       return result
     if dt3[1]:
       manifest.setDirty()
     else:
       manifest.clearDirty()
     cjs.__manifest = manifest
   cjs.__initState = dataTuple[4]
   cjs.__insertIntoTQ = dataTuple[5]
   cjs.__dirtyKeys = set(dataTuple[6])
   return S_OK(cjs)