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

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

 



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.

Thanks,
Shigeki Sakamoto.

_______________________________________________
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