File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ def __init__(
9696 except Exception :
9797 raise ConfigurationError (_INVALID_HOST_MSG % (fqdn ,)) from None
9898 self .__slen = len (self .__plist )
99+ self .nparts = len (self .__fqdn .split ("." ))
99100
100101 async def get_options (self ) -> Optional [str ]:
101102 from dns import resolver
@@ -138,7 +139,7 @@ async def _get_srv_response_and_hosts(
138139 # Validate hosts
139140 for node in nodes :
140141 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 :
142143 raise ConfigurationError (
143144 "Invalid SRV host: return address is identical to SRV hostname"
144145 )
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ def __init__(
9696 except Exception :
9797 raise ConfigurationError (_INVALID_HOST_MSG % (fqdn ,)) from None
9898 self .__slen = len (self .__plist )
99+ self .nparts = len (self .__fqdn .split ("." ))
99100
100101 def get_options (self ) -> Optional [str ]:
101102 from dns import resolver
@@ -138,7 +139,7 @@ def _get_srv_response_and_hosts(
138139 # Validate hosts
139140 for node in nodes :
140141 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 :
142143 raise ConfigurationError (
143144 "Invalid SRV host: return address is identical to SRV hostname"
144145 )
You can’t perform that action at this time.
0 commit comments