File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ def __init__(
96
96
except Exception :
97
97
raise ConfigurationError (_INVALID_HOST_MSG % (fqdn ,)) from None
98
98
self .__slen = len (self .__plist )
99
+ self .nparts = len (self .__fqdn .split ("." ))
99
100
100
101
async def get_options (self ) -> Optional [str ]:
101
102
from dns import resolver
@@ -138,7 +139,7 @@ async def _get_srv_response_and_hosts(
138
139
# Validate hosts
139
140
for node in nodes :
140
141
srv_host = node [0 ].lower ()
141
- if self .__fqdn == srv_host and len ( srv_host . split ( "." )) < 3 :
142
+ if self .__fqdn == srv_host and self . nparts < 3 :
142
143
raise ConfigurationError (
143
144
"Invalid SRV host: return address is identical to SRV hostname"
144
145
)
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ def __init__(
96
96
except Exception :
97
97
raise ConfigurationError (_INVALID_HOST_MSG % (fqdn ,)) from None
98
98
self .__slen = len (self .__plist )
99
+ self .nparts = len (self .__fqdn .split ("." ))
99
100
100
101
def get_options (self ) -> Optional [str ]:
101
102
from dns import resolver
@@ -138,7 +139,7 @@ def _get_srv_response_and_hosts(
138
139
# Validate hosts
139
140
for node in nodes :
140
141
srv_host = node [0 ].lower ()
141
- if self .__fqdn == srv_host and len ( srv_host . split ( "." )) < 3 :
142
+ if self .__fqdn == srv_host and self . nparts < 3 :
142
143
raise ConfigurationError (
143
144
"Invalid SRV host: return address is identical to SRV hostname"
144
145
)
You can’t perform that action at this time.
0 commit comments