Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2295

MongoClient with multiple hosts and directConnection=True does not raise an error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.11
    • Component/s: None
    • Labels:
      None

      Description

      Passing multiple hosts with directConnection=True should raise an error but does not:

      >>> client = MongoClient(['localhost:27017', 'localhost:27018'], directConnection=True)
      >>> client
      MongoClient(host=['localhost:27018', 'localhost:27017'], document_class=dict, tz_aware=False, connect=True, directconnection=True)
      >>> client._topology
      <Topology <TopologyDescription id: 5ee92ea84355c7f1de7bd6cb, topology_type: Single, servers: [<ServerDescription ('localhost', 27017) server_type: RSPrimary, rtt: 0.000634608000012804>, <ServerDescription ('localhost', 27018) server_type: RSSecondary, rtt: 0.0005638819999944644>]>>
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              prashant.mital Prashant Mital (Inactive)
              Reporter:
              shane.harvey Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: