On 8/8/11 4:37 PM, Shawn Walker wrote:
On 08/08/11 15:14, Drew Fisher wrote:
Good afternoon,

Since we're dealing with a very tight window for pushing of this fix to
the slim_source gate, I'd like to get a preemptive code review for the
following CRs:

7072842 <http://monaco.us.oracle.com/detail.jsf?cr=7072842> update
install gate for pkg5 API version bump to 66
7076306 <http://monaco.us.oracle.com/detail.jsf?cr=7076306> slim source
needs a common import for pkg5 API number

https://cr.opensolaris.org/action/browse/caiman/drewfish/7072842/webrev/

usr/src/cmd/installadm/image.py:

line 320: Why return set variants=True here? I can't imagine that a package that isn't installable in the current system will be interesting for your purposes.

line 324: You've specified all_variants here, but your search for a matching attribute ignores the fact that more than one action could be present for different variants. I suspect this code actually is looking for a single set action with a name of SVC_NAME_ATTR that isn't for a specific variant.

lines 323-328: It would be much faster to use the new 'attrs' dictionary returned by get_pkg_list() when you set collect_attrs=True. You should be able to completely replace these lines with:

   basename = attrs.get(self.SVC_NAME_ATTR,
       {}).get(tuple(), {}).get("value", "solarisx").strip()

The above of course assumes that you are expecting a set action with no specific variants set.

Alternatively, at the very least, you should not set all_variants=True in your call to get_manifest() and replace gen_actions() with gen_actions_by_type("set").


Most of the code in get_basename() was me fumbling through the API trying to find the right invocation to get the information we needed. I'll update the code with your changes and give a test.

Thanks, Shawn!

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

Reply via email to