Skip to content
Snippets Groups Projects
Commit b3bb118f authored by Fabrizio Benvenuti's avatar Fabrizio Benvenuti
Browse files

[ReportMailer] ensure board_type is uppercase, assert argument types

parent 04dbba04
Branches mailer
No related tags found
No related merge requests found
...@@ -9,17 +9,17 @@ import os ...@@ -9,17 +9,17 @@ import os
# Set up argument parser # Set up argument parser
parser = argparse.ArgumentParser(description="Send emails to ETMs and the Core Team, based on board type.") parser = argparse.ArgumentParser(description="Send emails to ETMs and the Core Team, based on board type.")
parser.add_argument('--board', required=True, help='Board type (e.g., c61, c12, c20)') parser.add_argument('--board',type=str, required=True, help='Board type (e.g., c61, c12, c20)')
parser.add_argument('--jsonfile', type=argparse.FileType('r'), required=True, help='File variable containing JSON data') parser.add_argument('--jsonfile', type=argparse.FileType('r'), required=True, help='File variable containing JSON data')
parser.add_argument('--attachment', required=False, default="report.pdf", help='Path to the file to attach (e.g., report.pdf)') parser.add_argument('--attachment',type=str, required=False, default="report.pdf", help='Path to the file to attach (e.g., report.pdf)')
parser.add_argument('--sender', required=True, help='Email address from which the email is sent') parser.add_argument('--sender',type=str, required=True, help='Email address from which the email is sent')
parser.add_argument('--email', required=True, help='Email address for authentication') parser.add_argument('--email',type=str, required=True, help='Email address for authentication')
parser.add_argument('--password', required=True, help='Password for email authentication') parser.add_argument('--password',type=str, required=True, help='Password for email authentication')
parser.add_argument('--smtp_server', required=False, default='smtp.office365.com', help='SMTP server address') parser.add_argument('--smtp_server',type=str, required=False, default='smtp.office365.com', help='SMTP server address')
parser.add_argument('--smtp_port', type=int, required=False, default='587', help='SMTP server port') parser.add_argument('--smtp_port', type=int, required=False, default='587', help='SMTP server port')
args = parser.parse_args() args = parser.parse_args()
board_type = args.board board_type = args.board.upper()
json_file = args.jsonfile json_file = args.jsonfile
attachment_path = args.attachment attachment_path = args.attachment
EMAIL_ADDRESS = args.email EMAIL_ADDRESS = args.email
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment