[main] option for installer upload to s3 (#1173)

Fixed issue with quoted regex when invoking upload_to_s3.py via script
Improved error handling in online install bootstrapper generation commands
This commit is contained in:
Scott Romero
2021-06-08 09:30:20 -07:00
committed by GitHub
3 changed files with 101 additions and 4 deletions
+5
View File
@@ -65,6 +65,11 @@ def get_client(service_name, profile_name):
def get_files_to_upload(base_dir, regex):
# Get all file names in base directory
files = [x for x in os.listdir(base_dir) if os.path.isfile(os.path.join(base_dir, x))]
# strip the surround quotes, if they exist
try:
regex = json.loads(regex)
except:
pass
# Get all file names matching the regular expression, those file will be uploaded to S3
files_to_upload = [x for x in files if re.match(regex, x)]
return files_to_upload