Example #1
0
 def __install_archives(self, archive_list):
     log.info("Installing archives")
     for archive in archive_list:
         log.info("--> archive: %s", archive)
         tar = ArchiveTar(self.xml_state.xml_data.description_dir + '/' +
                          archive)
         tar.extract(self.root_bind.root_dir)
Example #2
0
 def import_overlay_files(
     self, follow_links=False, preserve_owner_group=False
 ):
     """
         copy overlay files from the image description to
         the image root tree. Supported are a root/ directory
         or a root.tar.gz tarball. The root/ directory takes
         precedence over the tarball
     """
     overlay_directory = self.description_dir + '/root/'
     overlay_archive = self.description_dir + '/root.tar.gz'
     if os.path.exists(overlay_directory):
         log.info('Copying user defined files to image tree')
         rsync_options = [
             '-r', '-p', '-t', '-D', '-H', '-X', '-A', '--one-file-system'
         ]
         if follow_links:
             rsync_options.append('--copy-links')
         else:
             rsync_options.append('--links')
         if preserve_owner_group:
             rsync_options.append('-o')
             rsync_options.append('-g')
         Command.run(
             ['rsync'] + rsync_options + [
                 overlay_directory, self.root_dir
             ]
         )
     elif os.path.exists(overlay_archive):
         log.info('Extracting user defined files from archive to image tree')
         archive = ArchiveTar(overlay_archive)
         archive.extract(self.root_dir)
Example #3
0
 def __install_archives(self, archive_list):
     log.info("Installing archives")
     for archive in archive_list:
         log.info("--> archive: %s", archive)
         tar = ArchiveTar(
             self.xml_state.xml_data.description_dir + '/' + archive
         )
         tar.extract(self.root_bind.root_dir)