'Determine the ip address on the container. If inspect_data contains
Node.IP return that (e.g. running in Docker Swarm). If the hostname
is "localhost", look for NetworkSettings.Gateway. Otherwise, just
return the configured docker_hostname.
:type inspect_data: dict
:param inspect_data: output of docker inspect
:returns: IP address or hostname of the node the conatainer is
running on.'

def get_container_host(self, inspect_data):

    inspect_data = inspect_data[0]
    if ('Node' in inspect_data):
        return inspect_data['Node']['IP']
    elif ((self.attr.docker_hostname == 'localhost') and (not IS_OS_X)):
        return inspect_data['NetworkSettings']['Gateway']
    else:
        return self.attr.docker_hostname
