@@ -76,7 +76,7 @@ def __init__(self,
76
76
):
77
77
"""Construct a new InfluxDBClient object."""
78
78
self .__host = host
79
- self ._port = port
79
+ self .__port = port
80
80
self ._username = username
81
81
self ._password = password
82
82
self ._database = database
@@ -110,7 +110,7 @@ def __init__(self,
110
110
'Accept' : 'text/plain'
111
111
}
112
112
113
- # _baseurl and _host are properties to allow InfluxDBClusterClient
113
+ # _baseurl, _host and _port are properties to allow InfluxDBClusterClient
114
114
# to override them with thread-local variables
115
115
@property
116
116
def _baseurl (self ):
@@ -126,6 +126,13 @@ def _host(self):
126
126
def _get_host (self ):
127
127
return self .__host
128
128
129
+ @property
130
+ def _port (self ):
131
+ return self ._get_port ()
132
+
133
+ def _get_port (self ):
134
+ return self .__port
135
+
129
136
@staticmethod
130
137
def from_DSN (dsn , ** kwargs ):
131
138
"""Return an instance of :class:`~.InfluxDBClient` from the provided
@@ -806,6 +813,7 @@ def __init__(self,
806
813
setattr (self , method , self ._make_func (orig_attr ))
807
814
808
815
self ._client ._get_host = self ._get_host
816
+ self ._client ._get_port = self ._get_port
809
817
self ._client ._get_baseurl = self ._get_baseurl
810
818
self ._update_client_host (self .hosts [0 ])
811
819
@@ -856,6 +864,9 @@ def _get_baseurl(self):
856
864
def _get_host (self ):
857
865
return self ._thread_local .host
858
866
867
+ def _get_port (self ):
868
+ return self ._thread_local .port
869
+
859
870
def _make_func (self , orig_func ):
860
871
861
872
@wraps (orig_func )
0 commit comments