Comment 1 for bug 852311

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: [Bug 852311] [NEW] non-english locale prevent good ifconfig output parsing

Excerpts from Patrick Hetu's message of Sat Sep 17 01:42:11 UTC 2011:
> Public bug reported:
>
> In charm like mediawiki, munin, mysql, postgresql, rabbitmq-server the
> IP address is grab with this command:
>
> relation-set ip=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' |
> cut -d: -f2 | awk '{ print $1}'|head -n 1`
>
> It would be safer to force the C locale with the LANG=C prefix

Patrick, thanks for the bug report. Agreed that this whole set of code
is entirely too inflexible for long term use.

In fact, we're planning to get rid of that type of interaction entirely,
in favor of having the hostname embedded in the relations all the
time. The IP works for single-zone/region/cloud setups, but eventually
we'll want to be able to relate things across clouds, so doing things
like this inside charms will make said charms impossible to use for
that purpose.