ask / carrot

AMQP Messaging Framework for Python (discontinued; Use Kombu instead)
http://ask.github.com/carrot/
BSD 3-Clause "New" or "Revised" License
197 stars 34 forks source link

Docs specify "vhost" instead of "virtual_host" #15

Closed chrismiles closed 15 years ago

chrismiles commented 15 years ago

The docs specify using the "vhost" argument to create connections when it should actually be "virtual_host". This messed me about for ages until I finally looked through the code.

btw: using **kwargs in BrokerConnection.__init__() doesn't help as it masks incorrect arguments making it harder to debug problems.

Here's a diff to correct the docs:

diff --git a/README.rst b/README.rst
index 3c48b89..f638176 100644
--- a/README.rst
+++ b/README.rst
@@ -148,7 +148,7 @@ Creating a connection
     >>> from carrot.connection import BrokerConnection
     >>> conn = BrokerConnection(hostname="localhost", port=5672,
     ...                           userid="test", password="test",
-    ...                           vhost="test")
+    ...                           virtual_host="test")

     If you're using Django you can use the
diff --git a/carrot/connection.py b/carrot/connection.py
index 6221fc0..463f08a 100644
--- a/carrot/connection.py
+++ b/carrot/connection.py
@@ -170,7 +170,7 @@ class DjangoBrokerConnection(BrokerConnection):
     :keyword password: The users password. If not provided this is taken
         from ``settings.AMQP_PASSWORD``.

-    :keyword vhost: The name of the virtual host to work with.
+    :keyword virtual_host: The name of the virtual host to work with.
         This virtual host must exist on the server, and the user must
         have access to it. Consult your brokers manual for help with
         creating, and mapping users to virtual hosts. If not provided
ask commented 15 years ago

Ouch. I'm sorry for your long journey. Yeah, a recent change made the connection arguments optional, since there's a new backend introduced (STOMP) that doesn't support userid, password, virtual_host, etc. I've applied the docpatch. Thanks!