Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Commit e86f0a8

Browse files
authored
Merge pull request #76 from edx/release_061217
Deployment Bugfix
2 parents 5b8943e + b2b589a commit e86f0a8

File tree

5 files changed

+37
-24
lines changed

5 files changed

+37
-24
lines changed

VEDA_OS01/admin.py

+14
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,20 @@ class TranscriptProcessMetadataAdmin(admin.ModelAdmin):
151151
"""
152152
Admin for TranscriptProcessMetadata model.
153153
"""
154+
raw_id_fields = ('video', )
155+
list_display = ('get_video', 'provider', 'process_id', 'translation_id', 'lang_code', 'status')
156+
157+
def get_video(self, obj):
158+
return u'"{studio_id}" - "{edx_id}"'.format(
159+
studio_id=obj.video.studio_id,
160+
edx_id=obj.video.edx_id
161+
)
162+
163+
get_video.admin_order_field = 'video'
164+
get_video.short_description = 'Transcript Video'
165+
166+
search_fields = ['video__edx_id', 'video__studio_id', 'process_id', 'translation_id']
167+
154168
model = TranscriptProcessMetadata
155169

156170

VEDA_OS01/models.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -733,9 +733,8 @@ def update(self, **fields):
733733
self.save()
734734

735735
def __unicode__(self):
736-
return u'{video} - {provider} - {lang} - {status}'.format(
736+
return u'{video} - {provider} - {lang}'.format(
737737
video=self.video.edx_id,
738738
provider=self.provider,
739-
lang=self.lang_code,
740-
status=self.status,
739+
lang=self.lang_code
741740
)

control/veda_file_discovery.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ def get_or_create_course(self, course_id, course_hex=None):
186186
institution=course_key.org,
187187
edx_classid=course_key.course,
188188
local_storedir=course_id,
189+
yt_proc=False,
189190
)
190191
else:
191192
try:
@@ -249,7 +250,8 @@ def discover_studio_ingested_videos(self):
249250
connection = boto.connect_s3()
250251
self.bucket = connection.get_bucket(self.auth_dict['edx_s3_ingest_bucket'])
251252
for video_s3_key in self.bucket.list(self.auth_dict['edx_s3_ingest_prefix'], '/'):
252-
self.validate_metadata_and_feed_to_ingest(video_s3_key=self.bucket.get_key(video_s3_key.name))
253+
if video_s3_key.name != 'prod-edx/unprocessed/':
254+
self.validate_metadata_and_feed_to_ingest(video_s3_key=self.bucket.get_key(video_s3_key.name))
253255
except S3ResponseError:
254256
ErrorObject.print_error(message='[File Ingest] S3 Ingest Connection Failure')
255257
except NoAuthHandlerFound:

static_config.yaml

-9
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ encode_dict:
2929
mobile_override:
3030
- override
3131
s3_proc:
32-
- mobile_high
3332
- mobile_low
3433
- audio_mp3
35-
- desktop_webm
3634
- desktop_mp4
3735
- hls
3836

@@ -51,17 +49,10 @@ val_profile_dict:
5149
override:
5250
- desktop_mp4
5351
- mobile_low
54-
- mobile_high
55-
56-
mobile_high:
57-
- mobile_high
5852

5953
audio_mp3:
6054
- audio_mp3
6155

62-
desktop_webm:
63-
- desktop_webm
64-
6556
youtube:
6657
- youtube
6758
review:

youtube_callback/sftp_id_retrieve.py

+18-11
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
"""
55
import datetime
66
import fnmatch
7+
import logging
78
import os
89
import shutil
910
import sys
1011
import xml.etree.ElementTree as ET
1112
from datetime import timedelta
1213
from os.path import expanduser
14+
from paramiko.ssh_exception import AuthenticationException
1315

1416
import django
1517
import pysftp
@@ -28,6 +30,9 @@
2830
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VEDA.settings.local')
2931
django.setup()
3032

33+
LOGGER = logging.getLogger(__name__)
34+
# TODO: Remove this temporary logging to stdout
35+
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
3136

3237
"""
3338
Defaults:
@@ -73,17 +78,19 @@ def xml_downloader(course):
7378

7479
cnopts = pysftp.CnOpts()
7580
cnopts.hostkeys = None
76-
77-
with pysftp.Connection(
78-
'partnerupload.google.com',
79-
username=course.yt_logon,
80-
private_key=private_key,
81-
port=19321,
82-
cnopts=cnopts
83-
) as s1:
84-
s1.timeout = 60.0
85-
for d in s1.listdir_attr():
86-
crawl_sftp(d=d, s1=s1)
81+
try:
82+
with pysftp.Connection(
83+
'partnerupload.google.com',
84+
username=course.yt_logon,
85+
private_key=private_key,
86+
port=19321,
87+
cnopts=cnopts
88+
) as s1:
89+
s1.timeout = 60.0
90+
for d in s1.listdir_attr():
91+
crawl_sftp(d=d, s1=s1)
92+
except AuthenticationException:
93+
LOGGER.info("{inst}{clss} : Authentication Failed".format(inst=course.institution, clss=course.edx_classid))
8794

8895

8996
def crawl_sftp(d, s1):

0 commit comments

Comments
 (0)