Factor out checkConnectionFailure.
Factor out checkConnectionFailure.

bogdanteleaga/juju,waigani/juju,frankban/juju-tmp,cmars/juju,cmars/juju,kat-co/juju,tsakas/juju,mhilton/juju-juju,mjs/juju,bac/juju,frankban/juju-tmp,frankban/juju,mjs/juju,bac/juju,mhilton/juju,marcmolla/juju,dooferlad/juju,Altoros/juju-cloudsigma,perrito666/juju,thomnico/juju,alesstimec/juju,mjs/juju,mhilton/juju,voidspace/juju,mhilton/juju-juju,tych0/juju,axw/juju,fwereade/juju,bac/juju,mikemccracken/juju,mjs/juju,makyo/juju,thomnico/juju,cloud-green/juju,anastasiamac/juju,macgreagoir/juju,bogdanteleaga/juju,bogdanteleaga/juju,perrito666/juju,marcoceppi/juju,macgreagoir/juju,voidspace/juju,waigani/juju,alesstimec/juju,tsakas/juju,Altoros/juju-vmware,fwereade/juju,AdamIsrael/juju,marcoceppi/juju,mhilton/juju-juju,cmars/juju,tasdomas/juju,waigani/juju,Altoros/juju-cloudsigma,cherylj/juju,perrito666/juju,mhilton/juju,marcoceppi/juju,anastasiamac/juju,tasdomas/juju,cmars/juju,axw/juju,mjs/juju,ericsnowcurrently/juju,cherylj/juju,wwitzel3/juju,howbazaar/juju,Altoros/juju-cloudsigma,fwereade/juju,thomnico/juju,mikemccracken/juju,bz2/juju,AdamIsrael/juju,cherylj/juju,davecheney/juju,howbazaar/juju,kat-co/juju,frankban/juju,ericsnowcurrently/juju,ericsnowcurrently/juju,wwitzel3/juju,voidspace/juju,anastasiamac/juju,bac/juju,sinzui/juju,macgreagoir/juju,frankban/juju,axw/juju,dimitern/juju,tsakas/juju,sinzui/juju,mikemccracken/juju,mikemccracken/juju,axw/juju,cloud-green/juju,mikemccracken/juju,reedobrien/juju,dooferlad/juju,kat-co/juju,tasdomas/juju,mhilton/juju,macgreagoir/juju,cherylj/juju,sinzui/juju,dooferlad/juju,gabriel-samfira/juju,tsakas/juju,marcoceppi/juju,kat-co/juju,axw/juju,anastasiamac/juju,ericsnowcurrently/juju,dimitern/juju,makyo/juju,frankban/juju-tmp,kat-co/juju,frankban/juju-tmp,makyo/juju,waigani/juju,dooferlad/juju,wwitzel3/juju,wwitzel3/juju,bz2/juju,howbazaar/juju,gabriel-samfira/juju,bz2/juju,Altoros/juju-cloudsigma,AdamIsrael/juju,alesstimec/juju,reedobrien/juju,Altoros/juju-vmware,Altoros/juju-vmware,sinzui/juju,Altoros/juju-vmware,dooferlad/juju,tych0/juju,voidspace/juju,bac/juju,alesstimec/juju,thomnico/juju,perrito666/juju,reedobrien/juju,dimitern/juju,marcmolla/juju,howbazaar/juju,tych0/juju,davecheney/juju,dimitern/juju,dimitern/juju,makyo/juju,gabriel-samfira/juju,tych0/juju,cloud-green/juju,anastasiamac/juju,alesstimec/juju,bz2/juju,howbazaar/juju,tasdomas/juju,frankban/juju,marcmolla/juju,gabriel-samfira/juju,frankban/juju,bogdanteleaga/juju,AdamIsrael/juju,marcmolla/juju,mjs/juju,fwereade/juju,macgreagoir/juju,reedobrien/juju,davecheney/juju,ericsnowcurrently/juju,gabriel-samfira/juju,bz2/juju,mjs/juju,davecheney/juju,reedobrien/juju,mhilton/juju-juju,perrito666/juju,cloud-green/juju,marcmolla/juju