ask/kombu — Issue #87: mongodb hostname has dbname in it
Author: sylvinus
Created: 2011-12-21 23:58:53+00:00
State: open

Hi,

I had to apply the following patch to kombu 1.5.1 in transport/mongodb.py :

```
def _open(self):
conninfo = self.connection.client
a = (conninfo.hostname+"/").split("/")
conninfo.hostname=a[0]
conninfo.virtual_host=a[1]
mongoconn = Connection(host=conninfo.hostname, port=conninfo.port)
```

Here was my configuration:
```
-------------- celery@sylvain-zimmers-macbook-pro-2.local v2.4.5
---- **** -----
--- * *** * -- [Configuration]
-- * - **** --- . broker: mongodb://localhost:27017/joshfire_platform//
- ** ---------- . loader: celery.loaders.default.Loader
- ** ---------- . logfile: [stderr]@WARNING
- ** ---------- . concurrency: 4
- ** ---------- . events: OFF
- *** --- * --- . beat: OFF
-- ******* ----
--- ***** ----- [Queues]
-------------- . celery: exchange:celery (direct) binding:celery
```

Weirdly, the virtual_host/dbname was inside the conninfo.hostname variable. Python 2.6.1 on mac, pymongo 2.0.1, celery 2.4.5

Thanks!