[ovs-dev] [PATCH V2 2/2] XenServer: Don't reset on xe-toolstack-restart
Jason Kölker
jason at koelker.net
Sat Feb 7 06:33:08 UTC 2015
On Sat, Feb 7, 2015 at 5:34 AM, Ben Pfaff <blp at nicira.com> 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 <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?
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
More information about the dev
mailing list