Commit b2b589aa by Gregory Martin

Deployment Bugfix

parent 5b8943eb
...@@ -151,6 +151,20 @@ class TranscriptProcessMetadataAdmin(admin.ModelAdmin): ...@@ -151,6 +151,20 @@ class TranscriptProcessMetadataAdmin(admin.ModelAdmin):
""" """
Admin for TranscriptProcessMetadata model. Admin for TranscriptProcessMetadata model.
""" """
raw_id_fields = ('video', )
list_display = ('get_video', 'provider', 'process_id', 'translation_id', 'lang_code', 'status')
def get_video(self, obj):
return u'"{studio_id}" - "{edx_id}"'.format(
studio_id=obj.video.studio_id,
edx_id=obj.video.edx_id
)
get_video.admin_order_field = 'video'
get_video.short_description = 'Transcript Video'
search_fields = ['video__edx_id', 'video__studio_id', 'process_id', 'translation_id']
model = TranscriptProcessMetadata model = TranscriptProcessMetadata
......
...@@ -733,9 +733,8 @@ class TranscriptProcessMetadata(TimeStampedModel): ...@@ -733,9 +733,8 @@ class TranscriptProcessMetadata(TimeStampedModel):
self.save() self.save()
def __unicode__(self): def __unicode__(self):
return u'{video} - {provider} - {lang} - {status}'.format( return u'{video} - {provider} - {lang}'.format(
video=self.video.edx_id, video=self.video.edx_id,
provider=self.provider, provider=self.provider,
lang=self.lang_code, lang=self.lang_code
status=self.status,
) )
...@@ -186,6 +186,7 @@ class FileDiscovery(object): ...@@ -186,6 +186,7 @@ class FileDiscovery(object):
institution=course_key.org, institution=course_key.org,
edx_classid=course_key.course, edx_classid=course_key.course,
local_storedir=course_id, local_storedir=course_id,
yt_proc=False,
) )
else: else:
try: try:
...@@ -249,6 +250,7 @@ class FileDiscovery(object): ...@@ -249,6 +250,7 @@ class FileDiscovery(object):
connection = boto.connect_s3() connection = boto.connect_s3()
self.bucket = connection.get_bucket(self.auth_dict['edx_s3_ingest_bucket']) self.bucket = connection.get_bucket(self.auth_dict['edx_s3_ingest_bucket'])
for video_s3_key in self.bucket.list(self.auth_dict['edx_s3_ingest_prefix'], '/'): for video_s3_key in self.bucket.list(self.auth_dict['edx_s3_ingest_prefix'], '/'):
if video_s3_key.name != 'prod-edx/unprocessed/':
self.validate_metadata_and_feed_to_ingest(video_s3_key=self.bucket.get_key(video_s3_key.name)) self.validate_metadata_and_feed_to_ingest(video_s3_key=self.bucket.get_key(video_s3_key.name))
except S3ResponseError: except S3ResponseError:
ErrorObject.print_error(message='[File Ingest] S3 Ingest Connection Failure') ErrorObject.print_error(message='[File Ingest] S3 Ingest Connection Failure')
......
...@@ -29,10 +29,8 @@ encode_dict: ...@@ -29,10 +29,8 @@ encode_dict:
mobile_override: mobile_override:
- override - override
s3_proc: s3_proc:
- mobile_high
- mobile_low - mobile_low
- audio_mp3 - audio_mp3
- desktop_webm
- desktop_mp4 - desktop_mp4
- hls - hls
...@@ -51,17 +49,10 @@ val_profile_dict: ...@@ -51,17 +49,10 @@ val_profile_dict:
override: override:
- desktop_mp4 - desktop_mp4
- mobile_low - mobile_low
- mobile_high
mobile_high:
- mobile_high
audio_mp3: audio_mp3:
- audio_mp3 - audio_mp3
desktop_webm:
- desktop_webm
youtube: youtube:
- youtube - youtube
review: review:
......
...@@ -4,12 +4,14 @@ Check SFTP dropboxes for YT Video ID XML information ...@@ -4,12 +4,14 @@ Check SFTP dropboxes for YT Video ID XML information
""" """
import datetime import datetime
import fnmatch import fnmatch
import logging
import os import os
import shutil import shutil
import sys import sys
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
from datetime import timedelta from datetime import timedelta
from os.path import expanduser from os.path import expanduser
from paramiko.ssh_exception import AuthenticationException
import django import django
import pysftp import pysftp
...@@ -28,6 +30,9 @@ if project_path not in sys.path: ...@@ -28,6 +30,9 @@ if project_path not in sys.path:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VEDA.settings.local') os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VEDA.settings.local')
django.setup() django.setup()
LOGGER = logging.getLogger(__name__)
# TODO: Remove this temporary logging to stdout
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
""" """
Defaults: Defaults:
...@@ -73,7 +78,7 @@ def xml_downloader(course): ...@@ -73,7 +78,7 @@ def xml_downloader(course):
cnopts = pysftp.CnOpts() cnopts = pysftp.CnOpts()
cnopts.hostkeys = None cnopts.hostkeys = None
try:
with pysftp.Connection( with pysftp.Connection(
'partnerupload.google.com', 'partnerupload.google.com',
username=course.yt_logon, username=course.yt_logon,
...@@ -84,6 +89,8 @@ def xml_downloader(course): ...@@ -84,6 +89,8 @@ def xml_downloader(course):
s1.timeout = 60.0 s1.timeout = 60.0
for d in s1.listdir_attr(): for d in s1.listdir_attr():
crawl_sftp(d=d, s1=s1) crawl_sftp(d=d, s1=s1)
except AuthenticationException:
LOGGER.info("{inst}{clss} : Authentication Failed".format(inst=course.institution, clss=course.edx_classid))
def crawl_sftp(d, s1): def crawl_sftp(d, s1):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment