@celery_app.task(base=ArchiverTask, ignore_result=False)
@logged('make_copy_request')
def make_copy_request(job_pk, url, data):
 create_app_context()
 job = ArchiveJob.load(job_pk)
 (src, dst, user) = job.info()
 provider = data['source']['provider']
 logger.info('Sending copy request for addon: {0} on node: {1}'.format(provider, dst._id))
 res = requests.post(url, data=json.dumps(data))
 if (res.status_code not in (http.OK, http.CREATED, http.ACCEPTED)):
  raise HTTPError(res.status_code)

@ celery_app . task ( base = ArchiverTask , ignore_result = False ) @ logged ( 'make_copy_request' ) def make_copy_request ( job_pk , url , data ) : create_app_context ( ) job = ArchiveJob . load ( job_pk ) ( src , dst , user ) = job . info ( ) provider = data [ 'source' ] [ 'provider' ] logger . info ( 'Sending copy request for addon: {0} on node: {1}' . format ( provider , dst . _id ) ) res = requests . post ( url , data = json . dumps ( data ) ) if ( res . status_code not in ( http . OK , http . CREATED , http . ACCEPTED ) ) : raise HTTPError ( res . status_code )
make the copy request to the waterbulter api and handle successful and failed responses .