Exemplo n.º 1
0
 def expire_id(self,rec,id,TESTMODE=0):
   self.logger.debug("Calling do expire with queue=%s id=%s TM=%d"%(rec['system'],id,TESTMODE))
   req=doexpire.apply_async([rec],queue=rec['system'])
   self.logger.info("expire request queued s=%s t=%s"%(rec['system'],id))
   self.task_image_id[req]=id
   self.expire_requests[req]=id
   self.tasks.append(req)
Exemplo n.º 2
0
  def expire(self,session,image,TESTMODE=0):
      """Expire an image.  (Not Implemented)"""
      if not self.isadmin(session,image['system']):
          return False
      q={'system':image['system'],
        'itype':image['itype'],
        'tag':{'$in':[image['tag']]}}
      rec=self.images.find_one(q)
      if rec is None:
          return None
      id=rec.pop('_id')
      self.logger.debug("Calling do expire with queue=%s id=%s TM=%d"%(image['system'],id,TESTMODE))
      req=doexpire.apply_async([rec],queue=image['system'],
                kwargs={'TESTMODE':TESTMODE})
      self.logger.info("expire request queued s=%s t=%s"%(image['system'],image['tag']))
      self.task_image_id[req]=id
      self.expire_requests[req]=id
      self.tasks.append(req)

      return True