Ejemplo n.º 1
0
 def __isPatchReadyToInstall__(self, patchInfo, patchList = None):
   packageName = patchInfo.package
   ver = patchInfo.version
   patchHist = self._vistaPatchInfo.getPackagePatchHistByName(packageName, ver)
   if not patchHist or not patchHist.hasPatchHistory():
     logger.info("no patch hist for %s, ver: %s" % (packageName, ver))
     return True # if no such an package or hist info, just return True
   """ check patch sequence no to see if it is out of order """
   if patchInfo.seqNo:
     seqNo = patchHist.getLatestSeqNo()
     if patchInfo.seqNo < seqNo:
       logger.error("SeqNo out of order, %s less than latest one %s" %
                     (patchInfo.seqNo), seqNo)
       return False
   # check all the dependencies
   for item in patchInfo.depKIDSPatch:
     if patchList and item in self._patchSet: # we are going to install the dep patch
       logger.info("We are going to install the patch %s" % item)
       """ make sure installation is in the right order """
       itemIndex = self.indexInPatchList(item, patchList)
       patchIndex = self.indexInPatchList(patchInfo.installName, patchList)
       if itemIndex >= patchIndex:
         logger.warn("%s is out of order with %s" % (item, patchInfo))
         return False
       else:
         continue
     (namespace,ver,patch) = extractInfoFromInstallName(item)
     if self._vistaPatchInfo.hasPatchInstalled(item, namespace, ver, patch):
       logger.debug("%s is arelady installed" % item)
       continue
     else:
       logger.error("dep %s is not installed for %s %s" %
                   (item, patchInfo.installName, patchInfo.kidsFilePath))
       return False
   return True
Ejemplo n.º 2
0
 def __reloadPackagePatchHistory__(self, patchInfo):
   patchHistInfo = self._vistaPatchInfo
   installNameList = []
   if patchInfo.isMultiBuilds:
     installNameList = patchInfo.multiBuildsList
   else:
     installNameList.append(patchInfo.installName)
   for installName in installNameList:
     (namespace,ver,patch) = extractInfoFromInstallName(installName)
     if not patchHistInfo.hasNamespace(namespace):
       patchHistInfo.createAllPackageMapping()
     if patchHistInfo.hasNamespace(namespace):
       packageName = patchHistInfo.getPackageName(namespace)
       patchHistInfo.getPackagePatchHistory(packageName, namespace, ver)
Ejemplo n.º 3
0
 def __reloadPackagePatchHistory__(self, patchInfo):
     patchHistInfo = self._vistaPatchInfo
     installNameList = []
     if patchInfo.isMultiBuilds:
         installNameList = patchInfo.multiBuildsList
     else:
         installNameList.append(patchInfo.installName)
     for installName in installNameList:
         (namespace, ver, patch) = extractInfoFromInstallName(installName)
         if not patchHistInfo.hasNamespace(namespace):
             patchHistInfo.createAllPackageMapping()
         if patchHistInfo.hasNamespace(namespace):
             packageName = patchHistInfo.getPackageName(namespace)
             patchHistInfo.getPackagePatchHistory(packageName, namespace, ver)
Ejemplo n.º 4
0
 def __isPatchReadyToInstall__(self, patchInfo, patchList = None):
   packageName = patchInfo.package
   ver = patchInfo.version
   patchHist = self._vistaPatchInfo.getPackagePatchHistByName(packageName, ver)
   if not patchHist or not patchHist.hasPatchHistory():
     logger.info("no patch hist for %s, ver: %s" % (packageName, ver))
     return True # if no such an package or hist info, just return True
   """ check patch sequence no to see if it is out of order """
   if patchInfo.seqNo:
     seqNo = patchHist.getLatestSeqNo()
     if patchInfo.seqNo < seqNo:
       logger.error("SeqNo out of order, %s less than latest one %s" %
                     (patchInfo.seqNo), seqNo)
       return False
   # check all the dependencies
   for item in patchInfo.depKIDSPatch:
     if patchList and item in self._patchSet: # we are going to install the dep patch
       logger.info("We are going to install the patch %s" % item)
       """ make sure installation is in the right order """
       itemIndex = self.indexInPatchList(item, patchList)
       patchIndex = self.indexInPatchList(patchInfo.installName, patchList)
       if itemIndex >= patchIndex:
         logger.warn("%s is out of order with %s" % (item, patchInfo))
         return False
       else:
         continue
     (namespace,ver,patch) = extractInfoFromInstallName(item)
     if self._vistaPatchInfo.hasPatchInstalled(item, namespace, ver, patch):
       logger.debug("%s is arelady installed" % item)
       continue
     installStatus = self._vistaPatchInfo.getInstallationStatus(item)
     if self._vistaPatchInfo.isInstallCompleted(installStatus):
       continue
     else:
       logger.error("dep %s is not installed for %s %s" %
                   (item, patchInfo.installName, patchInfo.kidsFilePath))
       return False
   return True