Mar-16-2022, 04:59 PM
(This post was last modified: Mar-16-2022, 04:59 PM by radioactive9.)
(Mar-16-2022, 04:22 PM)deanhystad Wrote: f" string formatting is new in Python 3.6. You need to do this:
print('Printing all arguments', ' '.join('"{}"'.format(a) if ' ' in a else a for a in sys.argv[1:]))
Worked like a charm and all the parameters looks very good. If i introduce --os it starts failing. If I remove - it goes forward and creates ticket. Look at --os it does have double quotes around it coming from the tool. even for --eventtime. That was the reason --eventtime never had the problem
Quote:Printing all arguments --IPAddress 00.00.00.00 --operatormw GSC_W_RUN --operatoros GSC_W_RUN --division Tech --environment PROD --eventtime "2022-03-16 17:33:53 +0100" --host wwwwwww754 --host_appname TEC-W --notificationtype RECOVERY --operator operator_os --os "Windows Server 2016 Standard" --priority OK --service SN-WIN-osservices
Another example
Quote:Printing all arguments --IPAddress 99.99.99.99 --operatormw RES_INFRA_NL --operatoros MOBILITY_LINUX --division TEC --environment PROD --eventtime "2022-03-16 17:57:38 +0100" --host fishfishfish --host_appname APPData --notificationtype PROBLEM --os "Red Hat Enterprise Linux 6" --operator operator_mw --priority CRITICAL --service SN-LIN-disk-non_slash
Not sure why I can't parse --os - any suggestion