db.master.uri is wrong

Bug #1612371 reported by Cory Johns
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pgsql Interface for charms.reactive
Fix Released
Critical
Stuart Bishop

Bug Description

In [10]: rel['db:4'].master.uri
Out[10]: 'postgresql://juju_review-queue:SJGPHw32wws7kmxCPFYnHKKmSYRTYXYW43f2@10.50.12.129:5432/review-queue'

In [11]: rel['db:4'].master.host
Out[11]: '10.50.12.126'

https://git.launchpad.net/interface-pgsql/tree/requires.py#n78 should be "c.uri =" instead of "self.uri =" but I also don't understand why __new__ was used instead of __init__, or even why it's a subclass of str.

Revision history for this message
Stuart Bishop (stub) wrote :

It is a subclass of str so it can be used with C extensions that expect a real immutable string without casting (like psycopg2 IIRC). Maybe this isn't the best choice, as I realized the other day you can't do 'conn_str.application_name = 'myname' to modify it.

Changed in interface-pgsql:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Stuart Bishop (stub)
Stuart Bishop (stub)
Changed in interface-pgsql:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.