/swift/common/utils.py >> whatremyips' output dependent on system locale

Bug #692491 reported by Allaedine El Banna
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Low
Unassigned

Bug Description

This is not a major bug, but if you try for example the French locale for your system on an Ubuntu 10.10, fr_FR.UTF8, you will notice that the output of the command /sbin/ifconfig is something like :

..."inet adr"...

instead of

... "inet addr"...

like the function common/utils.py/whataremyips() is waiting for.

I suggest another way to find the ip address of the machine.

This bug implies that you are forced to use English Locales to run Swift. Else, replicators cannot start for example.

Related branches

Changed in swift:
importance: Undecided → Low
Revision history for this message
Mike Barton (redbo) wrote :

I just spent a few minutes reminding myself why we don't get this information from the system more directly, and the answer is it's pretty freakin' hairy.

I bet we could just pass that popen call an env with LC_ALL=C or POSIX or whatever locale is always there. I'll look into it later today.

Revision history for this message
Ewan Mellor (ewanmellor) wrote :

The command "ip" is both non-locale sensitive and non-hirsute. Try "ip -o -f inet addr show dev eth0"

Revision history for this message
Ewan Mellor (ewanmellor) wrote :

Thanks, Launchpad, for word-wrapping that so well. That's

ip -o -f inet addr show dev eth0

Revision history for this message
Thierry Carrez (ttx) wrote :

Same kind of bug on Nova side: see bug 691044

Revision history for this message
FUJITA Tomonori (fujita-tomonori-deactivatedaccount) wrote :

Another option would be using netifaces package.

Revision history for this message
Mike Barton (redbo) wrote :

That seems like the best solution. I want to run the new dependency by a few core devs first, and there are a couple of things that will need to change for pep8 (camelCase and the blank line above the import).

Changed in swift:
status: New → Fix Committed
Chuck Thier (cthier)
Changed in swift:
milestone: none → 1.2.0
Chuck Thier (cthier)
Changed in swift:
status: Fix Committed → 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.