For each module that is downloaded a thread of this class is invoked, so that each of the module that is to be downloaded is done in parallel
| 151 | |
| 152 | |
| 153 | class module_thread(threading.Thread): |
| 154 | """ For each module that is downloaded a thread of this class is invoked, so |
| 155 | that each of the module that is to be downloaded is done in parallel |
| 156 | """ |
| 157 | def __init__(self, module): |
| 158 | self.module=module |
| 159 | self.config=config |
| 160 | self.machine_list=config.find_subscribed_machines_for_module(module) |
| 161 | self.location=config.find_location_for_module( module, 'stage_location') |
| 162 | threading.Thread.__init__(self) |
| 163 | |
| 164 | def run(self): |
| 165 | try: |
| 166 | download_distribute(self.module, self.machine_list, self.config) |
| 167 | except: |
| 168 | logger.error("[" +self.module + "]FTP Process for this module terminated as error") |
| 169 | logger.error("Error:" + str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1])) |
| 170 | download_status[module_id] = "FAILED" |
| 171 | |
| 172 | class config_file_util: |
| 173 | """ The class to handle all the configiration file related infornation |