(self, baseimage=None)
Actually build the image.
Actually build the image.
Actually build the image .
def BuildImage(self, baseimage=None):
    """Actually build the image."""
    sb = self.CreateSparseBundle()
    mounted_sparsebundle = self.MountSparseBundle(sb)
    self.GetBaseImage(baseimage)
    mounted_image = self.MountOSXInstallESD()
    self.InstallOSX(mounted_sparsebundle, mounted_image)
    self.GetBuildPackages()
    pkgs = os.path.join(self.cwd, BUILD, 'Packages/')
    pkgreport = self.InstallPackages(pkgs, mounted_sparsebundle)
    self.WriteImageInfo(mounted_sparsebundle, pkgreport)
    image_file = self.ConvertSparseBundle(mounted_sparsebundle, sb)
    self.CleanUp(sb, image_file)
    self.PrintReport(pkgreport)
    self.newimagepath = image_file
    print ('Created new image: %s' % os.path.join(BUILD,
                                                  os.path.basename(image_file)))
    if os.path.exists(os.path.join(self.cwd, 'lastimage')):
      os.unlink(os.path.join(self.cwd, 'lastimage'))
    f = open(os.path.join(self.cwd, 'lastimage'), 'w')
    f.write('/Users/Shared/can_haz_image/%s' % os.path.basename(image_file))
    f.close()
def BuildImage ( self , baseimage = None ) : sb = self . CreateSparseBundle ( ) mounted_sparsebundle = self . MountSparseBundle ( sb ) self . GetBaseImage ( baseimage ) mounted_image = self . MountOSXInstallESD ( ) self . InstallOSX ( mounted_sparsebundle , mounted_image ) self . GetBuildPackages ( ) pkgs = os . path . join ( self . cwd , BUILD , 'Packages/' ) pkgreport = self . InstallPackages ( pkgs , mounted_sparsebundle ) self . WriteImageInfo ( mounted_sparsebundle , pkgreport ) image_file = self . ConvertSparseBundle ( mounted_sparsebundle , sb ) self . CleanUp ( sb , image_file ) self . PrintReport ( pkgreport ) self . newimagepath = image_file print ( 'Created new image: %s' % os . path . join ( BUILD , os . path . basename ( image_file ) ) ) if os . path . exists ( os . path . join ( self . cwd , 'lastimage' ) ) : os . unlink ( os . path . join ( self . cwd , 'lastimage' ) ) f = open ( os . path . join ( self . cwd , 'lastimage' ) , 'w' ) f . write ( '/Users/Shared/can_haz_image/%s' % os . path . basename ( image_file ) ) f . close ( )