Merge lp:~marcoceppi/charms/precise/postgresql/ip-hostname-verification into lp:charms/postgresql

Proposed by Marco Ceppi
Status: Merged
Approved by: Kapil Thangavelu
Approved revision: 32
Merged at revision: 32
Proposed branch: lp:~marcoceppi/charms/precise/postgresql/ip-hostname-verification
Merge into: lp:charms/postgresql
Diff against target: 0 lines
To merge this branch: bzr merge lp:~marcoceppi/charms/precise/postgresql/ip-hostname-verification
Reviewer Review Type Date Requested Status
Kapil Thangavelu (community) Approve
Review via email: mp+148063@code.launchpad.net

Description of the change

This completes the changes made in rev:30, since ip addresses require a full CIDR, and not all cloud environments provide hostnames, this fix will make sure that hostnames are passed to the template untouched which IP addresses get a /32 appended to the private-addresses. I could not verify this on my local, but the following code executes as expected in the interpreter http://paste.ubuntu.com/1641245/

To post a comment you must log in.
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

instead of the join, or str('/') [ie. string a string], i'd suggest interpolation

ie. = "%s/32" % relation['private_address']

review: Approve
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

Thanks Kapil! I originally did concatenation via relation['private_address'] + '/32' but that produced weird hex values. I've updated to use interpolation as it's cleaner and easier to read.

33. By Marco Ceppi

Use interpolation instead of join

Preview Diff

Empty

Subscribers

People subscribed via source and target branches