Reads errors.json from optout_s3_bucket into error_numbers for removing from cleaned list
This commit is contained in:
parent
a29a40b6bb
commit
479b6efff1
|
|
@ -7,6 +7,7 @@ import os
|
||||||
import logging
|
import logging
|
||||||
import uuid
|
import uuid
|
||||||
import time
|
import time
|
||||||
|
import codecs
|
||||||
|
|
||||||
import phonenumbers
|
import phonenumbers
|
||||||
|
|
||||||
|
|
@ -189,6 +190,14 @@ class AFCMUniverseMapFile:
|
||||||
generate_mapped_file Generate the mapped file details
|
generate_mapped_file Generate the mapped file details
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
errors_filename_s3_key = "errors.json"
|
||||||
|
file_data_stream = self.optout_s3_connection.get_object(self.optout_s3_bucket,
|
||||||
|
errors_filename_s3_key)
|
||||||
|
self.error_numbers = json.load(codecs.getreader("utf-8")(file_data_stream))
|
||||||
|
except Exception as ex:
|
||||||
|
raise Exception(f"universe_map_file.generate_mapped_file: Failed to get {self.optout_s3_bucket}/{errors_filename_s3_key}: {ex}") from ex
|
||||||
|
|
||||||
# Loop the files from the map
|
# Loop the files from the map
|
||||||
for ufilename in self.mosaic_file_list:
|
for ufilename in self.mosaic_file_list:
|
||||||
self.process_file(ufilename)
|
self.process_file(ufilename)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue