I'm trying to run an ant job using python subprocess. Following is the command I'm trying to execute.
ant -f ../lib/java/build.xml -Dno-gen-thrift="" -Dtestargs "--protocol=binary --transport=buffered" run-testserver
But when I ran this using subprocess using following command
subprocess.call(['ant','-f','lib/java/build.xml','-Dno-gen-thrift=\"\"','-Dtestargs \"--protocol=binary --transport=buffered\"','run-testserver'])
I'm getting error saying "Unknown argument: --transport=buffered" .
Unknown argument: --protocol=binaty
ant [options] [target [target2 [target3] ...]]
Options:
-help, -h print this message
-projecthelp, -p print project help information ...........
Here '--protocol=binary' and '--transport=buffered' are command line arguments parsed to a java class executes using this ant script. Also following commands run without any issue, when I send only one arguement.
subprocess.call(['ant','-f','lib/java/build.xml','-Dno-gen-thrift=\"\"','-Dtestargs \"--protocol=binary\"','run-testserver'])
subprocess.call(['ant','-f','lib/java/build.xml','-Dno-gen-thrift=\"\"','-Dtestargs \"--transport=buffered\"','run-testserver'])
What is the reason for this?
shlex.split('-Dno-gen-thrift "" -Dtestargs "--protocol=binary --transport=buffered"')