[SPARK-5366][EC2] Check the mode of private key
[SPARK-5366][EC2] Check the mode of private key

Check the mode of private key file.

Author: liuchang0812 <liuchang0812@gmail.com>

Closes #4162 from Liuchang0812/ec2-script and squashes the following commits:

fc37355 [liuchang0812] quota file name
01ed464 [liuchang0812] more output
ce2a207 [liuchang0812] pep8
f44efd2 [liuchang0812] move code to real_main
8475a54 [liuchang0812] fix bug
cd61a1a [liuchang0812] import stat
c106cb2 [liuchang0812] fix trivis bug
89c9953 [liuchang0812] more output about checking private key
1177a90 [liuchang0812] remove commet
41188ab [liuchang0812] check the mode of private key

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