Commit 921a3e2b by Gregory Martin

Deployment Bugfix

parent f579279e
......@@ -249,7 +249,8 @@ class FileDiscovery(object):
connection = boto.connect_s3()
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'], '/'):
self.validate_metadata_and_feed_to_ingest(video_s3_key=self.bucket.get_key(video_s3_key.name))
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))
except S3ResponseError:
ErrorObject.print_error(message='[File Ingest] S3 Ingest Connection Failure')
except NoAuthHandlerFound:
......
......@@ -10,6 +10,7 @@ import sys
import xml.etree.ElementTree as ET
from datetime import timedelta
from os.path import expanduser
from paramiko.ssh_exception import AuthenticationException
import django
import pysftp
......@@ -73,17 +74,19 @@ def xml_downloader(course):
cnopts = pysftp.CnOpts()
cnopts.hostkeys = None
with pysftp.Connection(
'partnerupload.google.com',
username=course.yt_logon,
private_key=private_key,
port=19321,
cnopts=cnopts
) as s1:
s1.timeout = 60.0
for d in s1.listdir_attr():
crawl_sftp(d=d, s1=s1)
try:
with pysftp.Connection(
'partnerupload.google.com',
username=course.yt_logon,
private_key=private_key,
port=19321,
cnopts=cnopts
) as s1:
s1.timeout = 60.0
for d in s1.listdir_attr():
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):
......
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