def _tar(name, root, path=None, compress='bzip2'):
 if (path is None):
  path = os.path.join(salt.syspaths.BASE_FILE_ROOTS_DIR, 'img')
 if (not __salt__['file.directory_exists'](path)):
  try:
   __salt__['file.mkdir'](path)
  except Exception as exc:
   return {'Error': pprint.pformat(exc)}
 (compression, ext) = _compress(compress)
 tarfile = '{0}/{1}.tar.{2}'.format(path, name, ext)
 out = __salt__['archive.tar'](options='{0}pcf'.format(compression), tarfile=tarfile, sources='.', dest=root)

def _tar ( name , root , path = None , compress = 'bzip2' ) : if ( path is None ) : path = os . path . join ( salt . syspaths . BASE_FILE_ROOTS_DIR , 'img' ) if ( not __salt__ [ 'file.directory_exists' ] ( path ) ) : try : __salt__ [ 'file.mkdir' ] ( path ) except Exception as exc : return { 'Error' : pprint . pformat ( exc ) } ( compression , ext ) = _compress ( compress ) tarfile = '{0}/{1}.tar.{2}' . format ( path , name , ext ) out = __salt__ [ 'archive.tar' ] ( options = '{0}pcf' . format ( compression ) , tarfile = tarfile , sources = '.' , dest = root )
pack up image in a tar format .