def create_tmp_dir(function):
 @functools.wraps(function)
 def decorated_function(*args, **kwargs):
  tmp_dir_path = tempfile.mkdtemp()
  kwargs['tmp_dir_path'] = tmp_dir_path
  try:
   return function(*args, **kwargs)
  finally:
   utils.execute('rm', '-rf', tmp_dir_path)
 return decorated_function

def create_tmp_dir ( function ) : @ functools . wraps ( function ) def decorated_function ( * args , ** kwargs ) : tmp_dir_path = tempfile . mkdtemp ( ) kwargs [ 'tmp_dir_path' ] = tmp_dir_path try : return function ( * args , ** kwargs ) finally : utils . execute ( 'rm' , '-rf' , tmp_dir_path ) return decorated_function
creates temporary directory for rsync purposes .