Skip to content

Commit b022683

Browse files
committed
Merge pull request influxdata#178 from influxdb/issue_176
Allow mixed case in DSN (closes influxdata#176)
2 parents 411323b + 317497b commit b022683

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

influxdb/client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ def from_DSN(dsn, **kwargs):
142142
be used for the TCP connection; specify the UDP port with the
143143
additional `udp_port` parameter (cf. examples).
144144
"""
145-
dsn = dsn.lower()
146145

147146
init_args = {}
148147
conn_params = urlparse(dsn)
@@ -760,7 +759,6 @@ def from_DSN(dsn, client_base_class=InfluxDBClient,
760759
[<influxdb.client.InfluxDBClient at 0x7feb480295d0>,
761760
<influxdb.client.InfluxDBClient at 0x7feb438ec950>]
762761
"""
763-
dsn = dsn.lower()
764762
conn_params = urlparse(dsn)
765763
netlocs = conn_params.netloc.split(',')
766764
cluster_client = InfluxDBClusterClient(

tests/influxdb/client_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,3 +853,18 @@ def test_dsn_single_client(self):
853853
'https+influxdb://usr:pwd@host:8086/db',
854854
**{'ssl': False})
855855
self.assertEqual('http://host:8086', cli.clients[0]._baseurl)
856+
857+
def test_dsn_password_caps(self):
858+
cli = InfluxDBClusterClient.from_DSN(
859+
'https+influxdb://usr:pWd@host:8086/db')
860+
self.assertEqual('pWd', cli.clients[0]._password)
861+
862+
def test_dsn_mixed_scheme_case(self):
863+
cli = InfluxDBClusterClient.from_DSN(
864+
'hTTps+inFLUxdb://usr:pWd@host:8086/db')
865+
self.assertEqual('pWd', cli.clients[0]._password)
866+
self.assertEqual('https://host:8086', cli.clients[0]._baseurl)
867+
868+
cli = InfluxDBClusterClient.from_DSN(
869+
'uDP+influxdb://usr:pwd@host1:8086,usr:pwd@host2:8086/db')
870+
self.assertTrue(cli.clients[0].use_udp)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy