public function ensureConnection(Host $host)
    {
        if ($host->hasConnection()) {
            $connection = $host->getConnection();
            if ($connection->isConnected() === false && $connection->connect() === false) {
                throw new ConnectionException(sprintf('Could not connect to "%s" through "%s".', $host->getHostname(), $host->getConnectionType()));
            }

            return $connection;
        }

        throw new ConnectionException(sprintf('No connection adapter of type "%s" found on host.', $host->getConnectionType()));
    }