[SPARK-7806][EC2] Fixes that allow the spark_ec2.py tool to run with Python3
[SPARK-7806][EC2] Fixes that allow the spark_ec2.py tool to run with Python3

I have used this script to launch, destroy, start, and stop clusters successfully.

Author: meawoppl <meawoppl@gmail.com>

Closes #6336 from meawoppl/py3ec2spark and squashes the following commits:

2e87046 [meawoppl] Py3 compat fixes.

debugger87/spark,goldmedal/spark,spark-test/spark,kissmetrics/spark,kissmetrics/spark,aray/spark,hvanhovell/spark,gengliangwang/spark,cloud-fan/spark,rezasafi/spark,dongjoon-hyun/spark,map222/spark,rekhajoshm/spark,big-pegasus/spark,minixalpha/spark,liutang123/spark,saltstar/spark,nlalevee/spark,caneGuy/spark,liyichao/spark,zuotingbing/spark,darionyaphet/spark,ibm-research-ireland/sparkoscope,nchammas/spark,liyichao/spark,andrewor14/spark,SHASHANKB/spark,taroplus/spark,kimoonkim/spark,witgo/spark,publicRoman/spark,actuaryzhang/spark,poffuomo/spark,zzcclp/spark,janewangfb/spark,patrick-nicholson/spark,setjet/spark,kevinyu98/spark,apache/spark,ibm-research-ireland/sparkoscope,mdespriee/spark,maropu/spark,aokolnychyi/spark,ConeyLiu/spark,SnappyDataInc/spark,zhouyejoe/spark,byakuinss/spark,ptkool/spark,mdespriee/spark,UndeadBaneGitHub/spark,maropu/spark,BryanCutler/spark,shuangshuangwang/spark,BryanCutler/spark,matthewfranglen/spark,xuanyuanking/spark,mdespriee/spark,kevinyu98/spark,kiszk/spark,apache-spark-on-k8s/spark,aokolnychyi/spark,pgandhi999/spark,tengpeng/spark,ioana-delaney/spark,skonto/spark,apache/spark,liyichao/spark,milliman/spark,mahak/spark,SHASHANKB/spark,sureshthalamati/spark,panfengfeng/spark,janewangfb/spark,JerryLead/spark,Aegeaner/spark,actuaryzhang/spark,SHASHANKB/spark,brad-kaiser/spark,ueshin/apache-spark,adrian-ionescu/apache-spark,dbtsai/spark,MLnick/spark,gioenn/xSpark,holdenk/spark,xflin/spark,ericvandenbergfb/spark,maropu/spark,hhbyyh/spark,chuckchen/spark,publicRoman/spark,minixalpha/spark,kevinyu98/spark,srowen/spark,narahari92/spark,panfengfeng/spark,wangmiao1981/spark,kevinyu98/spark,srowen/spark,narahari92/spark,kimoonkim/spark,metamx/spark,caneGuy/spark,wzhfy/spark,someorz/spark,maropu/spark,lvdongr/spark,dhruve/spark,nilsgrabbert/spark,zhouyejoe/spark,spark-test/spark,alunarbeach/spark,aokolnychyi/spark,mzl9039/spark,LantaoJin/spark,ioana-delaney/spark,rezasafi/spark,big-pegasus/spark,jrshust/spark,HyukjinKwon/spark,debugger87/spark,apache-spark-on-k8s/spark,actuaryzhang/spark,kiszk/spark,JerryLead/spark,jiangxb1987/spark,facaiy/spark,zuotingbing/spark,hvanhovell/spark,haowu80s/spark,LantaoJin/spark,saturday-shi/spark,caneGuy/spark,zero323/spark,jlopezmalla/spark,xflin/spark,jlopezmalla/spark,ddna1021/spark,actuaryzhang/spark,1haodian/spark,dhruve/spark,setjet/spark,stanzhai/spark,byakuinss/spark,xuanyuanking/spark,bOOm-X/spark,janewangfb/spark,pgandhi999/spark,ajaysaini725/spark,ron8hu/spark,mzl9039/spark,actuaryzhang/spark,nchammas/spark,wangyum/spark,nchammas/spark,ddna1021/spark,ajaysaini725/spark,JerryLead/spark,witgo/spark,zzcclp/spark,publicRoman/spark,liutang123/spark,huang1900/spark,jianran/spark,ahnqirage/spark,SnappyDataInc/spark,aosagie/spark,ajaysaini725/spark,spark-test/spark,hhbyyh/spark,Panos-Bletsos/spark-cost-model-optimizer,wangmiao1981/spark,zuotingbing/spark,haowu80s/spark,shubhamchopra/spark,jlopezmalla/spark,chuckchen/spark,huang1900/spark,chuckchen/spark,mike0sv/spark,saturday-shi/spark,lvdongr/spark,map222/spark,markhamstra/spark,janewangfb/spark,SnappyDataInc/spark,shubhamchopra/spark,michalsenkyr/spark,skonto/spark,alunarbeach/spark,ptkool/spark,kissmetrics/spark,panfengfeng/spark,ioana-delaney/spark,techaddict/spark,akopich/spark,MLnick/spark,ptkool/spark,taroplus/spark,HyukjinKwon/spark,brad-kaiser/spark,zhouyejoe/spark,sureshthalamati/spark,WindCanDie/spark,SnappyDataInc/spark,zhouyejoe/spark,ueshin/apache-spark,milliman/spark,bravo-zhang/spark,huang1900/spark,apache-spark-on-k8s/spark,szhem/spark,ajaysaini725/spark,WindCanDie/spark,szhem/spark,saltstar/spark,saltstar/spark,ron8hu/spark,map222/spark,minixalpha/spark,haowu80s/spark,caneGuy/spark,liutang123/spark,wangmiao1981/spark,jianran/spark,ibm-research-ireland/sparkoscope,Panos-Bletsos/spark-cost-model-optimizer,sahilTakiar/spark,sureshthalamati/spark,cloud-fan/spark,big-pegasus/spark,tejasapatil/spark,actuaryzhang/spark,esi-mineset/spark,loneknightpy/spark,rednaxelafx/apache-spark,UndeadBaneGitHub/spark,publicRoman/spark,loneknightpy/spark,taroplus/spark,lvdongr/spark,nilsgrabbert/spark,byakuinss/spark,ahnqirage/spark,rikima/spark,nchammas/spark,lvdongr/spark,tengpeng/spark,rednaxelafx/apache-spark,SnappyDataInc/spark,xuanyuanking/spark,cin/spark,mike0sv/spark,joseph-torres/spark,andrewor14/spark,narahari92/spark,darionyaphet/spark,jianran/spark,minixalpha/spark,narahari92/spark,eyalfa/spark,adrian-ionescu/apache-spark,map222/spark,jlopezmalla/spark,tejasapatil/spark,lxsmnv/spark,hhbyyh/spark,apache/spark,aosagie/spark,szhem/spark,WeichenXu123/spark,lvdongr/spark,ajaysaini725/spark,kiszk/spark,1haodian/spark,rekhajoshm/spark,Panos-Bletsos/spark-cost-model-optimizer,BryanCutler/spark,yanboliang/spark,sureshthalamati/spark,mzl9039/spark,facaiy/spark,nlalevee/spark,xflin/spark,loneknightpy/spark,liutang123/spark,vinodkc/spark,rekhajoshm/spark,markhamstra/spark,nlalevee/spark,cin/spark,zzcclp/spark,saturday-shi/spark,huang1900/spark,hvanhovell/spark,panfengfeng/spark,wangmiao1981/spark,ptkool/spark,brad-kaiser/spark,milliman/spark,gengliangwang/spark,mike0sv/spark,skonto/spark,zero323/spark,markhamstra/spark,zero323/spark,akopich/spark,ericvandenbergfb/spark,ibm-research-ireland/sparkoscope,sachintyagi22/spark,eyalfa/spark,nilsgrabbert/spark,1haodian/spark,ddna1021/spark,akopich/spark,sahilTakiar/spark,mahak/spark,markhamstra/spark,BryanCutler/spark,goldmedal/spark,alunarbeach/spark,mike0sv/spark,joseph-torres/spark,debugger87/spark,zuotingbing/spark,icexelloss/spark,xflin/spark,SnappyDataInc/spark,debugger87/spark,LantaoJin/spark,ericvandenbergfb/spark,aosagie/spark,gengliangwang/spark,jkbradley/spark,xuanyuanking/spark,Panos-Bletsos/spark-cost-model-optimizer,taroplus/spark,guoxiaolongzte/spark,loneknightpy/spark,narahari92/spark,jkbradley/spark,markhamstra/spark,kimoonkim/spark,darionyaphet/spark,tengpeng/spark,srowen/spark,szhem/spark,someorz/spark,pronix/spark,WeichenXu123/spark,jiangxb1987/spark,shuangshuangwang/spark,stanzhai/spark,someorz/spark,pgandhi999/spark,bdrillard/spark,michalsenkyr/spark,bdrillard/spark,chuckchen/spark,metamx/spark,stanzhai/spark,bdrillard/spark,zzcclp/spark,LantaoJin/spark,ibm-research-ireland/sparkoscope,guoxiaolongzte/spark,ibm-research-ireland/sparkoscope,ptkool/spark,esi-mineset/spark,mahak/spark,bravo-zhang/spark,szhem/spark,map222/spark,nlalevee/spark,dbtsai/spark,gengliangwang/spark,highfei2011/spark,nilsgrabbert/spark,vinodkc/spark,zero323/spark,akopich/spark,ConeyLiu/spark,markhamstra/spark,icexelloss/spark,wzhfy/spark,pgandhi999/spark,nlalevee/spark,liutang123/spark,zero323/spark,alunarbeach/spark,map222/spark,adrian-ionescu/apache-spark,taroplus/spark,HyukjinKwon/spark,zzcclp/spark,ptkool/spark,liyichao/spark,brad-kaiser/spark,ueshin/apache-spark,sureshthalamati/spark,ibm-research-ireland/sparkoscope,aosagie/spark,tejasapatil/spark,kiszk/spark,aokolnychyi/spark,xuanyuanking/spark,stanzhai/spark,dongjoon-hyun/spark,shubhamchopra/spark,dbtsai/spark,cloud-fan/spark,ddna1021/spark,rednaxelafx/apache-spark,lxsmnv/spark,rikima/spark,jrshust/spark,shuangshuangwang/spark,hhbyyh/spark,shaneknapp/spark,pgandhi999/spark,wzhfy/spark,setjet/spark,panfengfeng/spark,pgandhi999/spark,stanzhai/spark,saltstar/spark,debugger87/spark,darionyaphet/spark,michalsenkyr/spark,WindCanDie/spark,jiangxb1987/spark,goldmedal/spark,icexelloss/spark,guoxiaolongzte/spark,nilsgrabbert/spark,zhouyejoe/spark,sahilTakiar/spark,ddna1021/spark,JerryLead/spark,apache/spark,ericvandenbergfb/spark,adrian-ionescu/apache-spark,zzcclp/spark,andrewor14/spark,loneknightpy/spark,Aegeaner/spark,vinodkc/spark,MLnick/spark,skonto/spark,akopich/spark,cin/spark,patrick-nicholson/spark,zero323/spark,gioenn/xSpark,rekhajoshm/spark,rednaxelafx/apache-spark,shuangshuangwang/spark,nlalevee/spark,goldmedal/spark,mzl9039/spark,liutang123/spark,shubhamchopra/spark,mike0sv/spark,techaddict/spark,tejasapatil/spark,bdrillard/spark,poffuomo/spark,vinodkc/spark,shubhamchopra/spark,metamx/spark,jianran/spark,mahak/spark,WeichenXu123/spark,srowen/spark,publicRoman/spark,saturday-shi/spark,kevinyu98/spark,WeichenXu123/spark,patrick-nicholson/spark,icexelloss/spark,saltstar/spark,rednaxelafx/apache-spark,1haodian/spark,patrick-nicholson/spark,hvanhovell/spark,maropu/spark,facaiy/spark,wzhfy/spark,jiangxb1987/spark,Aegeaner/spark,andrewor14/spark,brad-kaiser/spark,dbtsai/spark,LantaoJin/spark,WindCanDie/spark,poffuomo/spark,shaneknapp/spark,mahak/spark,MLnick/spark,xuanyuanking/spark,highfei2011/spark,cin/spark,ericvandenbergfb/spark,kissmetrics/spark,WindCanDie/spark,apache-spark-on-k8s/spark,setjet/spark,1haodian/spark,SHASHANKB/spark,jrshust/spark,joseph-torres/spark,ron8hu/spark,dhruve/spark,eyalfa/spark,sahilTakiar/spark,aokolnychyi/spark,andrewor14/spark,narahari92/spark,sachintyagi22/spark,patrick-nicholson/spark,JerryLead/spark,highfei2011/spark,sachintyagi22/spark,aokolnychyi/spark,techaddict/spark,lxsmnv/spark,tengpeng/spark,dongjoon-hyun/spark,nilsgrabbert/spark,actuaryzhang/spark,wzhfy/spark,zhouyejoe/spark,janewangfb/spark,highfei2011/spark,shaneknapp/spark,Panos-Bletsos/spark-cost-model-optimizer,chuckchen/spark,gioenn/xSpark,sahilTakiar/spark,vinodkc/spark,shaneknapp/spark,kissmetrics/spark,esi-mineset/spark,kissmetrics/spark,gengliangwang/spark,WeichenXu123/spark,setjet/spark,rikima/spark,jiangxb1987/spark,shubhamchopra/spark,JerryLead/spark,dongjoon-hyun/spark,techaddict/spark,wangmiao1981/spark,markhamstra/spark,stanzhai/spark,HyukjinKwon/spark,wzhfy/spark,mzl9039/spark,loneknightpy/spark,bravo-zhang/spark,gioenn/xSpark,icexelloss/spark,minixalpha/spark,byakuinss/spark,witgo/spark,adrian-ionescu/apache-spark,yanboliang/spark,jlopezmalla/spark,HyukjinKwon/spark,rezasafi/spark,rezasafi/spark,shuangshuangwang/spark,mzl9039/spark,eyalfa/spark,someorz/spark,esi-mineset/spark,publicRoman/spark,poffuomo/spark,jianran/spark,bOOm-X/spark,aray/spark,holdenk/spark,spark-test/spark,ueshin/apache-spark,liyichao/spark,aray/spark,zuotingbing/spark,guoxiaolongzte/spark,ahnqirage/spark,UndeadBaneGitHub/spark,alunarbeach/spark,ahnqirage/spark,milliman/spark,esi-mineset/spark,bravo-zhang/spark,darionyaphet/spark,skonto/spark,sachintyagi22/spark,metamx/spark,rikima/spark,sachintyagi22/spark,ueshin/apache-spark,ericvandenbergfb/spark,poffuomo/spark,skonto/spark,wzhfy/spark,hvanhovell/spark,Aegeaner/spark,1haodian/spark,zero323/spark,icexelloss/spark,andrewor14/spark,dhruve/spark,tengpeng/spark,Aegeaner/spark,wangyum/spark,cin/spark,mahak/spark,wangmiao1981/spark,nlalevee/spark,ConeyLiu/spark,joseph-torres/spark,dhruve/spark,dongjoon-hyun/spark,ioana-delaney/spark,byakuinss/spark,akopich/spark,apache-spark-on-k8s/spark,yanboliang/spark,wangyum/spark,ron8hu/spark,shaneknapp/spark,UndeadBaneGitHub/spark,mdespriee/spark,mike0sv/spark,metamx/spark,WindCanDie/spark,ueshin/apache-spark,chuckchen/spark,ahnqirage/spark,pronix/spark,hhbyyh/spark,joseph-torres/spark,1haodian/spark,jkbradley/spark,Aegeaner/spark,JoshRosen/spark,srowen/spark,jianran/spark,dbtsai/spark,ddna1021/spark,spark-test/spark,ron8hu/spark,holdenk/spark,ahnqirage/spark,metamx/spark,WindCanDie/spark,minixalpha/spark,pronix/spark,mike0sv/spark,facaiy/spark,debugger87/spark,cin/spark,milliman/spark,BryanCutler/spark,szhem/spark,JoshRosen/spark,dbtsai/spark,xflin/spark,ahnqirage/spark,jrshust/spark,SHASHANKB/spark,maropu/spark,ron8hu/spark,nchammas/spark,rednaxelafx/apache-spark,taroplus/spark,cloud-fan/spark,rezasafi/spark,eyalfa/spark,sureshthalamati/spark,rezasafi/spark,LantaoJin/spark,cloud-fan/spark,rikima/spark,esi-mineset/spark,ioana-delaney/spark,ddna1021/spark,liyichao/spark,sahilTakiar/spark,pronix/spark,sahilTakiar/spark,poffuomo/spark,aray/spark,tengpeng/spark,tejasapatil/spark,jkbradley/spark,goldmedal/spark,aosagie/spark,yanboliang/spark,byakuinss/spark,kiszk/spark,jlopezmalla/spark,techaddict/spark,saturday-shi/spark,holdenk/spark,alunarbeach/spark,pronix/spark,kiszk/spark,goldmedal/spark,kimoonkim/spark,milliman/spark,milliman/spark,bOOm-X/spark,saltstar/spark,apache-spark-on-k8s/spark,JerryLead/spark,dongjoon-hyun/spark,shaneknapp/spark,saltstar/spark,patrick-nicholson/spark,mahak/spark,bOOm-X/spark,mdespriee/spark,someorz/spark,saturday-shi/spark,bdrillard/spark,gengliangwang/spark,jlopezmalla/spark,akopich/spark,ron8hu/spark,hhbyyh/spark,MLnick/spark,michalsenkyr/spark,spark-test/spark,minixalpha/spark,xflin/spark,lxsmnv/spark,highfei2011/spark,shaneknapp/spark,UndeadBaneGitHub/spark,ptkool/spark,loneknightpy/spark,yanboliang/spark,shubhamchopra/spark,guoxiaolongzte/spark,JoshRosen/spark,andrewor14/spark,dongjoon-hyun/spark,shuangshuangwang/spark,brad-kaiser/spark,narahari92/spark,jkbradley/spark,haowu80s/spark,facaiy/spark,witgo/spark,rekhajoshm/spark,sureshthalamati/spark,LantaoJin/spark,ueshin/apache-spark,cin/spark,bravo-zhang/spark,skonto/spark,BryanCutler/spark,cloud-fan/spark,zhouyejoe/spark,vinodkc/spark,bdrillard/spark,gengliangwang/spark,dbtsai/spark,big-pegasus/spark,wangyum/spark,eyalfa/spark,mdespriee/spark,haowu80s/spark,wangyum/spark,big-pegasus/spark,caneGuy/spark,bdrillard/spark,srowen/spark,gioenn/xSpark,jrshust/spark,techaddict/spark,kissmetrics/spark,hvanhovell/spark,facaiy/spark,MLnick/spark,eyalfa/spark,esi-mineset/spark,kimoonkim/spark,JoshRosen/spark,gioenn/xSpark,ConeyLiu/spark,publicRoman/spark,mdespriee/spark,michalsenkyr/spark,gioenn/xSpark,aray/spark,lxsmnv/spark,poffuomo/spark,witgo/spark,rekhajoshm/spark,janewangfb/spark,holdenk/spark,huang1900/spark,techaddict/spark,ConeyLiu/spark,zuotingbing/spark,liyichao/spark,tejasapatil/spark,adrian-ionescu/apache-spark,JoshRosen/spark,hvanhovell/spark,wangyum/spark,rekhajoshm/spark,UndeadBaneGitHub/spark,lvdongr/spark,apache/spark,map222/spark,rikima/spark,jiangxb1987/spark,tejasapatil/spark,maropu/spark,huang1900/spark,apache-spark-on-k8s/spark,rednaxelafx/apache-spark,WeichenXu123/spark,BryanCutler/spark,Panos-Bletsos/spark-cost-model-optimizer,spark-test/spark,darionyaphet/spark,brad-kaiser/spark,nilsgrabbert/spark,highfei2011/spark,HyukjinKwon/spark,pronix/spark,kiszk/spark,UndeadBaneGitHub/spark,witgo/spark,big-pegasus/spark,bravo-zhang/spark,bOOm-X/spark,jkbradley/spark,lxsmnv/spark,ajaysaini725/spark,bravo-zhang/spark,pgandhi999/spark,witgo/spark,Panos-Bletsos/spark-cost-model-optimizer,setjet/spark,sachintyagi22/spark,xflin/spark,yanboliang/spark,michalsenkyr/spark,liutang123/spark,SnappyDataInc/spark,joseph-torres/spark,chuckchen/spark,mzl9039/spark,wangyum/spark,aokolnychyi/spark,taroplus/spark,adrian-ionescu/apache-spark,szhem/spark,jkbradley/spark,ConeyLiu/spark,caneGuy/spark,JoshRosen/spark,shuangshuangwang/spark,ioana-delaney/spark,jrshust/spark,stanzhai/spark,kimoonkim/spark,hhbyyh/spark,ajaysaini725/spark,facaiy/spark,ConeyLiu/spark,byakuinss/spark,michalsenkyr/spark,alunarbeach/spark,huang1900/spark,wangmiao1981/spark,janewangfb/spark,dhruve/spark,SHASHANKB/spark,apache/spark,debugger87/spark,SHASHANKB/spark,tengpeng/spark,holdenk/spark,someorz/spark,metamx/spark,zuotingbing/spark,ioana-delaney/spark,patrick-nicholson/spark,vinodkc/spark,jiangxb1987/spark,nchammas/spark,rezasafi/spark,srowen/spark,highfei2011/spark,lxsmnv/spark,zzcclp/spark,aray/spark,bOOm-X/spark,JoshRosen/spark,icexelloss/spark,WeichenXu123/spark,setjet/spark,haowu80s/spark,jrshust/spark,big-pegasus/spark,MLnick/spark,HyukjinKwon/spark,ericvandenbergfb/spark,saturday-shi/spark,nchammas/spark,dhruve/spark,rikima/spark,panfengfeng/spark,sachintyagi22/spark,panfengfeng/spark,darionyaphet/spark,guoxiaolongzte/spark,Aegeaner/spark,kimoonkim/spark,joseph-torres/spark,someorz/spark,aray/spark,bOOm-X/spark,caneGuy/spark,aosagie/spark,apache/spark,holdenk/spark,aosagie/spark,cloud-fan/spark,jianran/spark,yanboliang/spark,goldmedal/spark,lvdongr/spark,kevinyu98/spark,xuanyuanking/spark,kevinyu98/spark,guoxiaolongzte/spark