Commit 921a3e2b by Gregory Martin

Deployment Bugfix

parent f579279e
...@@ -249,6 +249,7 @@ class FileDiscovery(object): ...@@ -249,6 +249,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')
......
...@@ -10,6 +10,7 @@ import sys ...@@ -10,6 +10,7 @@ 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
...@@ -73,7 +74,7 @@ def xml_downloader(course): ...@@ -73,7 +74,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 +85,8 @@ def xml_downloader(course): ...@@ -84,6 +85,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:
print "{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