> >
> > usr/src/cmd/distro_const/checkpoints/create_iso.py
> > --------------------------------------------------
> > 118: The lack of symmetry between SPARC and X86
> makes
> > me curious: When
> > would be the case where dc_pers_dict wouldn't
> exist?
> > Would it be an
> > rror condition?
> dc_pers_dict (the persistent dictionary) does not get
> automatically created by DC
> unlike dc_dict (the volatile dictionary) which has to
> be initialised with pkg_img_path from
> the get go. dc_pers_dict being present depends on one
> of the checkpoints creating it so
> there is no guarantee for it to be there. We do
> expect it to be there on X86 however since
> we expect the boot-setup checkpoint to store the
> bios-eltorito-img key/val
>
> If it would be an error condition,
> could you:
> > 1) Move lines 114 and 119 before the if on 111 and
> > remove the else on 118
> > 2) Let the lack of dc_pers_dict raise an exception
> > when it is not found?
>
> Factoring in Drew's suggestions, how about the
> following:
>
> if self.arch == 'i386':
> self.dc_pers_dict =
> self.doc.persistent.get_children(
> name=DC_PERS_LABEL,
> class_type=DataObjectDict,
>
> ot_found_is_err=True)[0].data_dict
> self.bios_eltorito =
> self.dc_pers_dict["bios-eltorito-img"]
>
> This way, it is only treated as an error on X86.
>
>
Responding to my own response, that isn't quite what I was aiming for.
I think this is more appropriate. As it tries to find the DC persistent
dictionary
on SPARC and X86 but only flagging it is as an error if not found on X86.
It then looks up the bios-eltorito-img key on X86.
# Look for DC persistent dictionary. Force an error if not found
# on X86 since the 'bios-eltorito-img' key is required.
dc_pers_dict = self.doc.persistent.get_children(
name = DC_PERS_LABEL,
class_type=DataObjectDict,
not_found_is_err=(self.arch=='i386'))
if dc_pers_dict:
self.dc_pers_dict = dc_pers_dict[0].data_dict
if self.arch == 'i386'
self.bios_eltorito = self.dc_pers_dict["bios-eltorito-img"]
Sorry, I'm still under the weather with a bad headache so concentrating is
difficult ;-)
Niall
--
This message posted from opensolaris.org
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss