Re: [PATCH][virt-clone] Check the MAC addressconfliction with ignoring character case.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 03, 2007 at 06:16:32PM +0900, S.Sakamoto wrote:
> Hi, Dan
> Thank you for advice.
> 
> > Instead of doing this:
> > 
> > > +            mac_index = (str(doc).upper()).find(mac.upper())
> > > +            if mac_index == -1:
> > > +                continue
> > > +            mac_comp = str(doc)[mac_index:mac_index+17]
> > 
> > 
> > Can't you simply use the 'lower-case()' function in XPath ?
> > 
> > eg something like
> > 
> >   count(/domain/devices/interface/mac[lower-case(@address)=lower-case('%s')])
> > 
> But, the 'lower-case()' function is not included in XPath 1.0 and is included in XPath 2.0.
> libxml only implements XPath 1.0.
> The 'translate()' function may simplify it.

Ah, I didn't realize it was new in 2.0. Don't worry about changing it - i'll
apply your current patch.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux