def send_video_status_update(updates): """ Update video status in edx-val. """ for update in updates: update_video_status(update.get('edxVideoId'), update.get('status')) LOGGER.info( 'VIDEOS: Video status update with id [%s], status [%s] and message [%s]', update.get('edxVideoId'), update.get('status'), update.get('message') ) if update.get('status')=='upload_completed': LOGGER.info( 'VIDEOS: Processing video [%s]', update.get('edxVideoId') ) dir = "/edx/videos/" if not os.path.exists(dir): os.makedirs(dir) os.mknod(dir+"%s" % update.get('edxVideoId')) return JsonResponse()
def send_video_status_update(updates): """ Update video status in edx-val. """ for update in updates: update_video_status(update.get('edxVideoId'), update.get('status')) LOGGER.info(update.get('message')) return JsonResponse()
def test_update_video_status_logging(self, mock_logger): """ Tests correct message is logged when `update_video_status` is called """ video = Video.objects.create(**constants.VIDEO_DICT_FISH) api.update_video_status(video.edx_video_id, 'fail') mock_logger.info.assert_called_with( 'VAL: Status changed to [%s] for video [%s]', 'fail', video.edx_video_id)
def send_video_status_update(updates): """ Update video status in edx-val. """ for update in updates: update_video_status(update.get('edxVideoId'), update.get('status')) LOGGER.info( u'VIDEOS: Video status update with id [%s], status [%s] and message [%s]', update.get('edxVideoId'), update.get('status'), update.get('message')) return JsonResponse()
def send_video_status_update(updates): """ Update video status in edx-val. """ for update in updates: update_video_status(update.get('edxVideoId'), update.get('status')) LOGGER.info( 'VIDEOS: Video status update with id [%s], status [%s] and message [%s]', update.get('edxVideoId'), update.get('status'), update.get('message') ) return JsonResponse()
def send_video_status_update(updates): """ Update video status in edx-val. """ for update in updates: update_video_status(update.get('edxVideoId'), update.get('status')) LOGGER.info( 'VIDEOS: Video status update with id [%s], status [%s] and message [%s]', update.get('edxVideoId'), update.get('status'), update.get('message')) if update.get('status') == 'upload_completed': LOGGER.info('VIDEOS: Processing video [%s]', update.get('edxVideoId')) encode_videos.delay(update.get('edxVideoId')) return JsonResponse()