[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] [PATCH 4/6] IPv6 support: update the create network wizard



On 03/29/2013 12:54 PM, Gene Czarcinski wrote:

> I now understand what the problem is and have two proposed solutions:
> 
> 1. in host.py, there is:
>> self.widget("net-list").get_selection().connect("changed",
>> self.net_selected)
> 2.  Sometimes but not always, this results in set_selected() being called. 
> Again, sometimes when net_selected() is called, the parameters it is passed
> points to a list-entry which has benn or is in the proccess of being deleted. 
> Regardless, when net_selected() executes:
>> net = self.conn.get_net(selected[0].get_value(selected[1], 0))
> and conn.get_net() blindly trys to lookup the network in the "nets" dictionary
> kept by connections.py.  The result is an exception because, by this time,
> that network has been deleted from the dictionary.
> 
> Solutions:
> 
> 1. In connections.py, change get_net() so that it checks to see if the network
> is defined in the dictionary, if it is return the usual; if it is not, return
> None.  This means that net_selected (and every other caller of get_net()) must
> check the result it gets from get_net().
> 
> 2. Leave get_net() as is.  Change net_selected() in host.py to "try" the call
> to get_net() and if an exception occurs, simply ignore it (return) but issue
> no error messages.
> 
> For now, the simplest is #2 but the whole business of handling changes to the
> lists needs to be examined and the code error-proofed.
> 
> I am proceeding with 2.
> 

Thanks for debugging, that fix sounds fine.

- Cole


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]