@sync_performer
def perform_download_packages_from_repository(dispatcher, intent):
 rpm_version = make_rpm_version(intent.flocker_version)
 package_type = intent.distribution.package_type()
 s = requests.Session()
 s.mount('file://', FileAdapter())
 downloaded_packages = set()
 for package in intent.packages:
  package_name = package_filename(package_type=package_type, package=package, architecture=PACKAGE_ARCHITECTURE[package], rpm_version=rpm_version)
  url = ((intent.source_repo + '/') + package_name)
  local_path = intent.target_path.child(package_name).path
  download = s.get(url)
  download.raise_for_status()
  content = download.content
  with open(local_path, 'wb') as local_file:
   local_file.write(content)
  downloaded_packages.add(package_name)
 return downloaded_packages

@ sync_performer def perform_download_packages_from_repository ( dispatcher , intent ) : rpm_version = make_rpm_version ( intent . flocker_version ) package_type = intent . distribution . package_type ( ) s = requests . Session ( ) s . mount ( 'file://' , FileAdapter ( ) ) downloaded_packages = set ( ) for package in intent . packages : package_name = package_filename ( package_type = package_type , package = package , architecture = PACKAGE_ARCHITECTURE [ package ] , rpm_version = rpm_version ) url = ( ( intent . source_repo + '/' ) + package_name ) local_path = intent . target_path . child ( package_name ) . path download = s . get ( url ) download . raise_for_status ( ) content = download . content with open ( local_path , 'wb' ) as local_file : local_file . write ( content ) downloaded_packages . add ( package_name ) return downloaded_packages
see :class:downloadpackagesfromrepository .