Forum Discussion

stucky101_88485's avatar
stucky101_88485
Icon for Nimbostratus rankNimbostratus
Aug 07, 2013

synchronize_to_group_v2 doesn't throw exception even if configs were not synced

Playing with config-sync and I found what I would consider undesired behaviour.

 

I have an HA active/standby group and when I make a change on the standby and try to overwrite it with the active the api simply exits.

 

No exception is caught, no message printed to stdout, no log at the LB level whatsoever. It's as if the call was never made.

 

 

lb.System.ConfigSync.synchronize_to_group_v2(device_group, 'ignored', False)

 

 

This will sync fine if the local unit has the most recent config though but if not it'll pretend to have synced but looking at the GUI you can see that it's still not synced.

 

This makes sense as the standby has a newer config. However this should cause an exception in my mind.

 

Forcing it will do the trick:

 

 

lb.System.ConfigSync.synchronize_to_group_v2(device_group, 'ignored', True)

 

 

My point is: Why would the api not throw an exception if it wasn't able to sync the configs ? This messes up my code since a try/except block is useless here and you never

 

know if it really synced unless you look at the GUI after.

 

Is this desired behaviour ?

 

Python2.6

 

5 Replies