From 314aa86f1e05aa7ef72ae2955eb72b2921bce33b Mon Sep 17 00:00:00 2001 From: SaadYousaf Date: Fri, 4 Feb 2022 12:07:41 +0500 Subject: [PATCH] fix: remove investigation logs --- common/lib/xmodule/xmodule/modulestore/xml.py | 13 ------------- .../lib/xmodule/xmodule/modulestore/xml_importer.py | 10 ---------- 2 files changed, 23 deletions(-) diff --git a/common/lib/xmodule/xmodule/modulestore/xml.py b/common/lib/xmodule/xmodule/modulestore/xml.py index 607349e916..745a81a261 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml.py +++ b/common/lib/xmodule/xmodule/modulestore/xml.py @@ -435,13 +435,8 @@ class XMLModuleStore(ModuleStoreReadBase): """ log.info(f'Course import {target_course_id}: Starting courselike import from {course_dir}') with open(self.data_dir / course_dir / self.parent_xml) as course_file: - if str(target_course_id) == 'course-v1:ArbiX+CS101+2014_T3': - log.info(f'Investigation Log: {target_course_id} : Getting course data') course_data = etree.parse(course_file, parser=edx_xml_parser).getroot() - if str(target_course_id) == 'course-v1:ArbiX+CS101+2014_T3': - log.info(f'Investigation Log: {target_course_id} : Course data fetching complete {course_data}') - org = course_data.get('org') if org is None: @@ -451,17 +446,11 @@ class XMLModuleStore(ModuleStoreReadBase): tracker(msg) org = 'edx' - if str(target_course_id) == 'course-v1:ArbiX+CS101+2014_T3': - log.info(f'Investigation Log: {target_course_id} : Org selected for course {org}') - # Parent XML should be something like 'library.xml' or 'course.xml' courselike_label = self.parent_xml.split('.', maxsplit=1)[0] course = course_data.get(courselike_label) - if str(target_course_id) == 'course-v1:ArbiX+CS101+2014_T3': - log.info(f'Investigation Log: {target_course_id} : Course {course} fetched from ' - f'courselike_label {courselike_label}') if course is None: msg = ( "No '{courselike_label}' attribute set for course in {dir}." @@ -500,8 +489,6 @@ class XMLModuleStore(ModuleStoreReadBase): 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': - log.info(f'Investigation Log: {target_course_id} : Course ID not in Course IDs (List)') return None def get_policy(usage_id): diff --git a/common/lib/xmodule/xmodule/modulestore/xml_importer.py b/common/lib/xmodule/xmodule/modulestore/xml_importer.py index 6a628c070f..493e333bb4 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml_importer.py +++ b/common/lib/xmodule/xmodule/modulestore/xml_importer.py @@ -544,8 +544,6 @@ class ImportManager: """ Iterate over the given directories and yield courses. """ - if str(self.target_id) == 'course-v1:ArbiX+CS101+2014_T3': - log.info(f'Investigation Log: {self.target_id} : Starting run imports') self.preflight() for courselike_key in self.xml_module_store.modules.keys(): try: @@ -560,18 +558,12 @@ class ImportManager: # Import all static pieces. self.import_static(data_path, dest_id) - if str(self.target_id) == 'course-v1:ArbiX+CS101+2014_T3': - log.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': - log.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': - log.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. @@ -582,8 +574,6 @@ class ImportManager: # 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': - log.info(f'Investigation Log: {self.target_id} : Import Draft Successful') yield courselike