[blivet:master 6/8] Add a method to extract information about an mdraid array

Vratislav Podzimek vpodzime at redhat.com
Thu Jul 17 06:41:26 UTC 2014


On Wed, 2014-07-16 at 13:09 -0400, Anne Mulhern wrote:
> > 
> > > +
> > > +    # extract the UUID proper
> > > +    the_uuid = re.match(r"(([a-f0-9]){8}:){3}([a-f0-9]){8}", info['UUID'])
> > This regex should be compiled as a global constant of the module.
> > 
> 
> The re module has some kind of internal cache for regular expressions.
> I'ld rather let it do its thing than hoist that one re so far from its
> one use.
Intersting, I didn't know about that. Alright then, just please add a
comment above with an example line, that always makes REs better
readable altough this is a simple one.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list