diff --git a/cms/djangoapps/contentstore/tasks.py b/cms/djangoapps/contentstore/tasks.py index f4c9c5d0d407..8a7172c0abfd 100644 --- a/cms/djangoapps/contentstore/tasks.py +++ b/cms/djangoapps/contentstore/tasks.py @@ -743,7 +743,7 @@ def validate_course_olx(courselike_key, course_dir, status): ignore=settings.COURSE_OLX_VALIDATION_IGNORE_LIST, allowed_xblocks=ALL_ALLOWED_XBLOCKS ) - except Exception: # pylint: disable=broad-except + except Exception as e: # pylint: disable=broad-except LOGGER.exception(f'{log_prefix}: CourseOlx could not be validated') return olx_is_valid diff --git a/common/lib/xmodule/xmodule/modulestore/xml.py b/common/lib/xmodule/xmodule/modulestore/xml.py index c84c7be722ee..f040dd4f33b7 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml.py +++ b/common/lib/xmodule/xmodule/modulestore/xml.py @@ -390,6 +390,8 @@ def try_load_course(self, course_dir, course_ids=None, target_course_id=None): course_descriptor.parent = None course_id = self.id_from_descriptor(course_descriptor) self._course_errors[course_id] = errorlog + if str(target_course_id) == 'course-v1:ArbiX+CS101+2014_T3': + logging.info(f'Investigation Log: {target_course_id} : {course_descriptor}') def __str__(self): ''' @@ -487,6 +489,8 @@ def load_course(self, course_dir, course_ids, tracker, target_course_id=None): course_id = self.get_id(org, course, url_name) if course_ids is not None and course_id not in course_ids: + if str(target_course_id) == 'course-v1:ArbiX+CS101+2014_T3': + logging.info(f'Investigation Log: {target_course_id} : Course ID not in Course IDs (List)') return None def get_policy(usage_id): @@ -522,6 +526,8 @@ def get_policy(usage_id): course_descriptor = system.process_xml(etree.tostring(course_data, encoding='unicode')) # If we fail to load the course, then skip the rest of the loading steps if isinstance(course_descriptor, ErrorBlock): + if str(target_course_id) == 'course-v1:ArbiX+CS101+2014_T3': + logging.info(f'Investigation Log: {target_course_id} : Course Descriptor is instance of ErrorBlock') return course_descriptor self.content_importers(system, course_descriptor, course_dir, url_name) diff --git a/common/lib/xmodule/xmodule/modulestore/xml_importer.py b/common/lib/xmodule/xmodule/modulestore/xml_importer.py index 493e333bb407..1a01d1ee6a3c 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml_importer.py +++ b/common/lib/xmodule/xmodule/modulestore/xml_importer.py @@ -544,6 +544,8 @@ def run_imports(self): """ Iterate over the given directories and yield courses. """ + if str(self.target_id) == 'course-v1:ArbiX+CS101+2014_T3': + logging.info(f'Investigation Log: {self.target_id} : Starting run imports') self.preflight() for courselike_key in self.xml_module_store.modules.keys(): try: @@ -558,12 +560,18 @@ def run_imports(self): # Import all static pieces. self.import_static(data_path, dest_id) + if str(self.target_id) == 'course-v1:ArbiX+CS101+2014_T3': + logging.info(f'Investigation Log: {self.target_id} : Import Static Successful') # Import asset metadata stored in XML. self.import_asset_metadata(data_path, dest_id) + if str(self.target_id) == 'course-v1:ArbiX+CS101+2014_T3': + logging.info(f'Investigation Log: {self.target_id} : Import Asset Metadata Successful') # Import all children self.import_children(source_courselike, courselike, courselike_key, dest_id) + if str(self.target_id) == 'course-v1:ArbiX+CS101+2014_T3': + logging.info(f'Investigation Log: {self.target_id} : Import Children Successful') # This bulk operation wraps all the operations to populate the draft branch with any items # from the /drafts subdirectory. @@ -573,6 +581,9 @@ def run_imports(self): with self.store.bulk_operations(dest_id): # Import all draft items into the courselike. courselike = self.import_drafts(courselike, courselike_key, data_path, dest_id) + if str(self.target_id) == 'course-v1:ArbiX+CS101+2014_T3': + logging.info(f'Investigation Log: {self.target_id} : Import Draft Successful') + yield courselike