Ejemplo n.º 1
0
 def check(self,isoimage):
     """Set image file"""
     imageData = Distributive().getInfo(isoimage)
     if not("os_linux_shortname" in imageData and \
            imageData.get('os_linux_build','') and \
         "os_arch_machine" in imageData):
         raise VariableError(_("Wrong image file"))
Ejemplo n.º 2
0
 def check(self,value):
     if value == 'on':
         try:
             imageData = Distributive().getInfo(self.Get('cl_image_filename'))
         except Exception as e:
             raise VariableError(_("Wrong image file"))
         if imageData.get('os_linux_build','') <= \
             self.Get('os_linux_build') or \
             imageData.get('os_linux_build','') <= self.installedBuild():
             raise CommonVariableError(_("The image for update not found"))
Ejemplo n.º 3
0
 def get(self):
     """Get image file from distributive repository"""
     try:
         if self.Get('cl_action') != 'system':
             return Distributive.fromFile('/')
         filename = self.Get('cl_image_filename')
         if filename:
             filename = Distributive.fromFile(filename)
     except DistributiveError as e:
         return ""
     return filename
Ejemplo n.º 4
0
 def installedBuild(self):
     """
     Get build already installed system
     Need for check update
     """
     imageData = None
     rootDev = self.Get('os_install_root_dev')
     if not rootDev:
         return ""
     try:
         imageData = Distributive().getInfo(rootDev)
         return imageData.get('os_linux_build','')
     except:
         pass
     return ""