# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: dwayne@oscl.ca-20080103155100-mlo6h984xosor96y
# target_branch: http://www.lag.net/paramiko/bzr/paramiko/
# testament_sha1: 4b20f77e6ff8de065b10dbc38a46bd13946423ef
# timestamp: 2008-01-03 09:51:39 -0600
# source_branch: http://www.lag.net/paramiko/bzr/paramiko/
# base_revision_id: robey@lag.net-20071231052950-8h599bnez3sgbf2e
# 
# Begin patch
=== modified file 'paramiko/client.py'
--- paramiko/client.py	2007-12-06 19:42:13 +0000
+++ paramiko/client.py	2008-01-03 15:51:00 +0000
@@ -213,7 +213,7 @@
         self._policy = policy
 
     def connect(self, hostname, port=22, username=None, password=None, pkey=None,
-                key_filename=None, timeout=None):
+                key_filename=None, timeout=None, allow_agent=True):
         """
         Connect to an SSH server and authenticate to it.  The server's host key
         is checked against the system host keys (see L{load_system_host_keys})
@@ -249,7 +249,9 @@
         @type key_filename: str
         @param timeout: an optional timeout (in seconds) for the TCP connect
         @type timeout: float
-        
+        @param allow_agent: set to False to disable connecting to the SSH agent
+        @type allow_agent: bool
+
         @raise BadHostKeyException: if the server's host key could not be
             verified
         @raise AuthenticationException: if authentication failed
@@ -288,7 +290,8 @@
 
         if username is None:
             username = getpass.getuser()
-        self._auth(username, password, pkey, key_filename)
+        
+        self._auth(username, password, pkey, key_filename, allow_agent)
     
     def close(self):
         """
@@ -364,7 +367,7 @@
         """
         return self._transport
         
-    def _auth(self, username, password, pkey, key_filename):
+    def _auth(self, username, password, pkey, key_filename, allow_agent):
         """
         Try, in order:
         
@@ -394,14 +397,15 @@
                     return
                 except SSHException, e:
                     saved_exception = e
-
-        for key in Agent().get_keys():
-            try:
-                self._log(DEBUG, 'Trying SSH agent key %s' % hexlify(key.get_fingerprint()))
-                self._transport.auth_publickey(username, key)
-                return
-            except SSHException, e:
-                saved_exception = e
+        
+        if allow_agent:
+            for key in Agent().get_keys():
+                try:
+                    self._log(DEBUG, 'Trying SSH agent key %s' % hexlify(key.get_fingerprint()))
+                    self._transport.auth_publickey(username, key)
+                    return
+                except SSHException, e:
+                    saved_exception = e
 
         keyfiles = []
         rsa_key = os.path.expanduser('~/.ssh/id_rsa')

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWYUFw0YAABHfgAAQQGFzUBIA
AACv794QIABkRR6nqaep6gZPUA9IxCjJqaBo09JpgjIMQ3m0vN/kfmJsLk0MHQ1W4qiRcX7dBKNJ
lorThQidj3YxTykvD4J5hd1FQti/6hzQ9gCghgPfGQ8nyFtaDiAA5JCZ68iW34u5IpwoSEKC4aMA
