Use correct hostname to get instances.

socket.getfqdn() would return a fully qualified domain name
which maybe invalid for nova to get instances by hostname.
If the host that runs devstack is virtual(like running
devstack on AWS), socket.getfqdn() may return a domain name
which is not the host name and nova cannot use that to get
instances running on current host.

Fix bug: #1166717

Change-Id: Ic6cc8607bcdeee720c5d46d44fbaa589b4fb950e
Allow to specify the endpoint type to use

Not everybody will want to use publicURL, so let's make this configurable.

Change-Id: Ice85a8ef1083580d89285e83239de872939665af
Fixes: bug#1188469
Merge "Allow to specify the endpoint type to use"
Merge "Use correct hostname to get instances."