On 06/26/12 14:43, Shawn Walker wrote:
On 06/25/12 17:25, Brock Pytlik wrote:
Webrev:
https://cr.opensolaris.org/action/browse/pkg/bpytlik/7177231-v1

Bug:
7177231 displayed license is always for installed copy if license file
is present

src/modules/actions/license.py:
line 193: Don't need open() here since fh is never used. get_data_digest() can accept either a path or fh, so i'd just pass it the path as you are now and drop the open() call. You should leave the exception handler in place though.
Thanks for catching that. I agree that opening it twice is silly, but I'm not thrilled with separating the open from the place where we catch the exception from the open for no real reason. So, I think I'll pass in the file handle and the length to get_data_digest, which should work just as well.


general: Not this bug, but I wonder what happens if we can't contact the publisher repository to retrieve the license payload. Do we traceback? If so, we should file a bug on that...
Nope, at least not if the repository is totally offline. Here's what we get:
$ /tmp/ips.test.6511/fakeroot/pkg -R /tmp/ips.test.6511/0/image0 -D plandesc_validate=1 --debug smf_cmds_dir=/tmp/ips.test.6511/0/smf_cmds info -r --license bronze
|
| Errors were encountered while attempting to retrieve package or file data for
| the requested operation.
| Details follow:
|
| Framework error: code: 7 reason: couldn't connect to host
| URL: 'http://localhost:12001/versions/0/'

Similarly, I would guess (though I haven't verified) that if the file on the server is missing we'll get a similar error only with a 404 for the file retrieval.


src/tests/cli/t_pkg_info.py:
  copyright update
Thanks.
Once I hear you're ok with the changes made, I'll put this back.

Brock


Thanks,
-Shawn

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

Reply via email to