Exemple #1
0
 def gen_fs_hash(self):
     '''Get the filesystem hash if the image class was created with a
     tar_file'''
     if self.__tar_file:
         fs_dir = rootfs.get_untar_dir(self.__tar_file)
         tar_file = rootfs.get_layer_tar_path(self.__tar_file)
         rootfs.extract_tarfile(tar_file, fs_dir)
         self.__fs_hash = rootfs.calc_fs_hash(fs_dir)
Exemple #2
0
 def gen_fs_hash(self):
     '''Get the filesystem hash if the image class was created with a
     tar_file'''
     if self.__tar_file:
         fs_dir = rootfs.get_untar_dir(self.__tar_file)
         tar_file = rootfs.get_layer_tar_path(self.__tar_file)
         # remove the fs directory if it already exists
         if os.path.isdir(fs_dir):
             rootfs.root_command(rootfs.remove, fs_dir)
         rootfs.extract_layer_tar(tar_file, fs_dir)
         self.__fs_hash = rootfs.calc_fs_hash(fs_dir)
Exemple #3
0
 def gen_fs_hash(self):
     '''Get the filesystem hash if the image class was created with a
     tar_file'''
     if self.tar_file:
         fs_dir = self.get_untar_dir()
         # make directory structure if it doesn't exist
         if not os.path.exists(fs_dir):
             os.makedirs(fs_dir)
         tar_file = os.path.join(rootfs.get_working_dir(), self.tar_file)
         rootfs.extract_tarfile(tar_file, fs_dir)
         self.__fs_hash = rootfs.calc_fs_hash(fs_dir)