def upload_file(self, remarks):
     file_name = self.get_file_name()
     
     file_obj = open(file_name, 'w')
     file_obj.write(remarks)
     file_obj.close()
     file_obj = open(file_name, 'r')
     destination = settings.FEED_FAILURE_DIR.format('bajaj')
     
     path = uploadFileToS3(destination=destination, file_obj=file_obj, 
               bucket=settings.FEED_FAILURE_BUCKET, file_mimetype='text/plain',
               logger_msg="Feed File Failure Uploaded")
     file_obj.close()
     
     os.remove("{0}/{1}".format(settings.BASE_DIR, file_name))
     
     return path
Ejemplo n.º 2
0
def upload_file(destination, bucket, file_obj,logger_msg):
    path = uploadFileToS3(destination=destination, file_obj=file_obj, 
                          bucket=bucket, logger_msg=logger_msg)
    return path