Comment 1 for bug 534397

Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 534397] [NEW] munin plugin suppresses numbers from VM names

On Mon, Mar 08, 2010 at 02:02:14PM -0000, Bernie Innocenti wrote:
> The valid regex should be [A-Za-z0-9_] (with numbers included).

Not exactly. According to

   http://munin-monitoring.org/wiki/notes_on_datasource_names

these two should do it:

s/^[^A-Za-z_]/_/
s/[^A-Za-z0-9_]/_/g

> Also, the entire canonicalize() function could be replaced with just one
> line:
>
> tr/A-Za-z0-9/_/c
>
> or even
>
> s/[^A-Za-z0-9]/_/g
>
>
> Perl's eclecticism :-)

Well, yeah, except this is Python :)

--
Soren Hansen
Ubuntu Developer
http://www.ubuntu.com/