On Sat, Feb 7, 2015 at 5:34 AM, Ben Pfaff <[email protected]> wrote: > On Thu, Feb 05, 2015 at 04:32:57AM +0000, Jason Kölker wrote: >> With XenServer only 1 manager is configured in the pool, which may not >> be the first manager returned from `get-manager` as it returns in >> lexicographical order. >> >> V2: Fixes vswitchCurrentControllers() to always return a list >> >> Signed-off-by: Jason Kölker <[email protected]> > > Thanks for the fix! One comment on this code: > >> +def vswitchCurrentControllers(): >> + controllers = vswitchCfgQuery(['get-manager']) >> + return [controller.lstrip('ssl:').split(':')[0] >> + for controller in controllers.split('\n') >> + if controller] > > If I understand the Python Library Reference correctly, lstrip("ssl:") > will remove all 's', 'l', and ':' characters from the beginning of the > controller name. That's not exactly the same as removing a fixed string > "ssl:", and it makes me a bit nervous. Would you mind doing it some > other way?
No problem, never even though of the case of it being a domain name ;(. I'll switch it to using str.replace. Happy Hacking! 7-11 _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
