[SPARK-11991] fixes
[SPARK-11991] fixes

If `--private-ips` is required but not provided, spark_ec2.py may behave inappropriately, including attempting to ssh to localhost in attempts to verify ssh connectivity to the cluster.

This fixes that behavior by raising a `UsageError` exception if `get_dns_name` is unable to determine a hostname as a result.

Author: Jeremy Derr <jcderr@radius.com>

Closes #9975 from jcderr/SPARK-11991/ec_spark.py_hostname_check.

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