mongolab / mongoctl

Manage MongoDB servers and replica sets using JSON configurations!
MIT License
178 stars 25 forks source link

Don't throw pointless errors on dev laptops whose names don't resolve #43

Closed bitprophet closed 6 years ago

bitprophet commented 6 years ago

Got kinda sick of always seeing errors like this anytime I use mongoctl or mongolab run-mongoctl on my laptop:

Unable to resolve address 'ec2-54-186-26-13.us-west-2.compute.amazonaws.com' for server 'mothership'. Cause: Invalid host 'tachi'. Cause: [Errno 8] nodename nor servname provided, or not known

This seems like an obvious correctness fix to me - if one is asking for IPs for a host and it doesn't even resolve, simply return empty list instead of erroring out. That way, higher level functions calling it (like...the one trying to determine if the target host is local) can work right instead of erroring out.