Skip to content

Commit d03c78f

Browse files
committed
determine is_srv differently
1 parent d343311 commit d03c78f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

pymongo/asynchronous/mongo_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
_Pipeline,
115115
)
116116
from pymongo.uri_parser import (
117+
SRV_SCHEME,
117118
_check_options,
118119
_handle_option_deprecations,
119120
_handle_security_options,
@@ -789,8 +790,8 @@ def __init__(
789790
normalize=False,
790791
srv_max_hosts=srv_max_hosts,
791792
)
793+
is_srv = entity.startswith(SRV_SCHEME)
792794
seeds.update(res["nodelist"])
793-
is_srv = res["is_srv"] or is_srv
794795
username = res["username"] or username
795796
password = res["password"] or password
796797
dbase = res["database"] or dbase

pymongo/synchronous/mongo_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
_Pipeline,
114114
)
115115
from pymongo.uri_parser import (
116+
SRV_SCHEME,
116117
_check_options,
117118
_handle_option_deprecations,
118119
_handle_security_options,
@@ -787,8 +788,8 @@ def __init__(
787788
normalize=False,
788789
srv_max_hosts=srv_max_hosts,
789790
)
791+
is_srv = entity.startswith(SRV_SCHEME)
790792
seeds.update(res["nodelist"])
791-
is_srv = res["is_srv"] or is_srv
792793
username = res["username"] or username
793794
password = res["password"] or password
794795
dbase = res["database"] or dbase

pymongo/uri_parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,6 @@ def _validate_uri(
586586
_check_options(nodes, options)
587587

588588
return {
589-
"is_srv": is_srv,
590589
"nodelist": nodes,
591590
"username": user,
592591
"password": passwd,

0 commit comments

Comments
 (0)