Pycontrol issue with setting default pool in virtual server

Hi,

I am quite new with the pycontrol (seems to be very useful tool) and now I am trying to set a default pool in virtual server that I have created.

In order to do that I did the following:

>>> v=b.LocalLB.VirtualServer

>>> p=b.LocalLB.Pool

>>> p.get_list()

[DGW_VIP_1, test, DGW_VIP_2]

>>> v.get_list()

[Alow_Routes, test]

>>> v.get_default_pool_name(virtual_servers=‘test’)

[]

>>> v.set_default_pool_name(virtual_servers=‘test’, default_pools=‘test’)

>>> v.get_default_pool_name(virtual_servers=‘test’)

[]

Where am I getting wrong with that?

Thanks Daniel.

Hi Daniel sorry you haven’t gotten a response yet. Anyhow, the issue is that you need to pass a list to your call, even if it has a single element. So wrap your argument of ‘test’ in square brackets to make it a python list and the call will work.

Hth,

Matt

Hi Daniel sorry you haven’t gotten a response yet. Anyhow, the issue is that you need to pass a list to your call, even if it has a single element. So wrap your argument of ‘test’ in square brackets to make it a python list and the call will work.

Hth,

Matt

Hi Daniel sorry you haven’t gotten a response yet. Anyhow, the issue is that you need to pass a list to your call, even if it has a single element. So wrap your argument of ‘test’ in square brackets to make it a python list and the call will work.

Hth,

Matt