[ovs-dev] [PATCH V2 2/2] XenServer: Don't reset on xe-toolstack-restart

Ben Pfaff blp at nicira.com
Sat Feb 7 05:34:39 UTC 2015


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 <jason at koelker.net>

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?

Thanks,

Ben.



More information about the dev mailing list