Shawn Walker wrote:
> Brock Pytlik wrote:
>> Bart Smaalders wrote:
>>> Brock Pytlik wrote:
>>>> t_pkg_api_install.py:
>>>> 476:I don't understand the changes made here. This should still 
>>>> fail during plan creation unless I've misunderstood something.
>>>>     
>>> The problem was we were calling api_obj.execute_plan()
>>> even though there was nothing to do; this meant we set the result code
>>> twice and blew up in the history modules.  Failing in plan_creation 
>>> is fine, we just need to handle the case when there's nothing to do 
>>> correctly.
>>>
>>>   
>> I think what I'm confused about is that before, I thought we blew up 
>> during the planning stage. If that's no longer the case, I'd like to 
>> understand why. In the gate tip, a PlanCreationException is raised 
>> inside image.make_install_plan because ba* didn't match any packages 
>> in the current catalog. If that exception's no longer being raised, 
>> I'd like to have a better understanding of why. Also, were installing 
>> ba* to work, then foo would be installed as a dependency of bar, so 
>> the exit code on line 476 really should be 0, not 1.
>>
>> I think this might be being caused by error not being set to 1 in the 
>> except block starting line 2085.
>
> Look at lines 157-164 of client/api.py.
>
> plan_install() can return True or False about nothingtodo() without 
> throwing an exception.
>
> This can happen for a noexecute case especially.
>
> If you then turn around and call plan_execute(); there will be a failure.
>
I understand all that. However, the gate tip throws an exception during 
plan_creation, and Bart's wad changes that behavior. I want to 
understand why that was changed, as I think I have with the issue of 
error = 1 not being set in the except block when something is added to 
illegal_fmri. I don't object to the change to check the return value. I 
do want to make sure we understand why test suite behavior is changing 
when it's not expected to.

As a side not, the _do_install function in that module was designed for 
exactly the tests that were being created in it. That's why return 
values aren't checked and it's not more robust. Also, note that given 
the current structure of _do_install, the no execute flag cannot be set. 
That means this can only blow up in the event that it's called with 
packages that are already up to date or cannot be installed. My personal 
belief is that for this testing setting, those tests shouldn't use 
_do_install and should instead do plan_install manually and explicitly 
check the nothingtodo flag in the imageplan. So, my slight preference 
would be for undoing all the changes in this module. I don't feel that 
strongly about it, so if others want to make the change on lines 
152-154, I won't object.

Brock
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to