related charm name should be escaped before use as db name

Bug #893088 reported by Michael Nelson
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
postgresql (Juju Charms Collection)
Fix Released
Undecided
Mark Mims

Bug Description

Currently it seems that the related charm/relationship name is used verbatim as the database name, which causes errors as it's not necessarily something that postgres accepts:

http://paste.ubuntu.com/745066/

Revision history for this message
Michael Nelson (michael.nelson) wrote :

hazmat added a fix yesterday, which I've just tried out, but it seems it replaces only the first hyphen:

{{{
2011-11-22 08:14:18,542 unit:postgresql/7: hook.output ERROR: ERROR: syntax error at or near "-"
LINE 1: grant all privileges on database apache_django-wsgi to apach...
}}}

(note: my charm is currently named apache-django-wsgi)

Revision history for this message
Michael Nelson (michael.nelson) wrote :

fwiw, there are a bunch of other errors being reported by the hook, but I've not checked if they're just fall-out: http://paste.ubuntu.com/745665/

Mark Mims (mark-mims)
Changed in postgresql (juju Charms Collection):
status: New → Fix Committed
assignee: nobody → Mark Mims (mark-mims)
Stuart Bishop (stub)
Changed in postgresql (Juju Charms Collection):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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